I am not a VBscript expert but I have looked all over the Internet for a solution and I cannot find one.
My primary goal is to create code that will be on a Outlook Contact. The code will add some new lines to the very bottom of the NOTES section of the contact and put the date, time and current user there. Then set the focus to the NOTES section and place the cursor at the end of the newly added text. Although not required, it would be nice if this code could be executed with a keyboard shortcut.
I have tried to solve this by added the following macro as a Quick Access Toolbar button on an Outlook Contact.
Dim myInspector As Outlook.Inspector
Dim myItem As Outlook.ContactItem
Set myInspector = Application.ActiveInspector
If Not TypeName(myInspector) = "Nothing" Then
If TypeName(myInspector.CurrentItem) = "ContactItem" Then
Set myItem = myInspector.CurrentItem
myItem.Body = myItem.Body & vbCrLf & vbCrLf & Now() & " : " & Application.GetNamespace("MAPI").CurrentUser & " - T"
MsgBox "The item is of the wrong type."
There are some problems with this solution:
1. If there are attachments anywhere in the notes, the attachments get pulled out of the notes and placed at the very end AFTER the newly added text.
2. It doesn't scroll the text in the notes area to make the new added text visible.
3. It doesn't set the focus to the notes box.
Any help is appreciated. Thanks.