Witzker
Senior Member
- OS Version(s)
- iOS
- Outlook version
- Outlook 2019 32-bit
- Email Account
- Exchange Server 2007
Hi
Here is the code
it puts a date AT THE TOP of The OL contact body
Pls help to put the date AT THE END of the contact body
What to change
THX
regards
Witzker
Here is the code
it puts a date AT THE TOP of The OL contact body
Pls help to put the date AT THE END of the contact body
Code:
Public Sub AddNote()
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
What to change
THX
regards
Witzker