Results 1 to 6 of 6

Thread: Help with macro to insert date at the end of oulook contact body

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    May 2018
    Posts
    50
    Location

    Question Help with macro to insert date at the end of oulook contact body

    I have found a macro that Inserts date at the top of the body

    Insert date at the top of the body
    
    Public Sub AddNoteTop()
        Dim DefaultMsg$ 
        DefaultMsg = "" 
        AddNote_Ex Application.ActiveInspector, DefaultMsg
    End Sub
    
    Private Sub AddNote_Ex(Inspector As Outlook.Inspector, Optional Msg As String)
        Dim WdSel As Word.Selection
        Dim p&
        Msg = Format(Date, "mm/dd/yyyy", vbUseSystemDayOfWeek, vbUseSystem) & ": " & Msg
        Msg = vbCrLf & "---" & vbCrLf & Msg
        Set WdSel = GetCurrentWordSelection(Inspector)
        p = Len(Msg) - 2
        WdSel.Start = 0
        WdSel.End = 0
        WdSel.InsertBefore Msg
        WdSel.Start = WdSel.Start + p
        WdSel.End = WdSel.Start
    End Sub
    
    Private Function GetCurrentWordSelection(OpenInspector As Outlook.Inspector) As Word.Selection
        Dim Doc As Word.Document
        Dim Wd As Word.Application 
        Set Doc = OpenInspector.WordEditor
        Set Wd = Doc.Application
        Set GetCurrentWordSelection = Wd.Selection
    End Function
    Can you Pls?
    Be so kind and tell me how to insert the text at the end of the body of a Contact Item in Outlook 2019
    And if possible in green
    THX in advance
    Last edited by Aussiebear; 02-27-2025 at 01:16 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •