Append to Notes Field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

For the Contacts in the current view (usually a category), I want a macro
that will 1) ask for a text input from the user; 2) precede the text with the
current date and time; then 3) append it to the Notes field of each Contact.
Or, I'd like info on a good substitute or add-in. Using Outlook2003, fully
updated, and XP Pro.

Any help appreciated.
 
John,

the current viewed items you can get with
Application.ActiveExplorer.Selection. For a simple user input use the
Input function, the current date and time is returned by the Now
function. Then write all these infos into each item´s Body property and
save them.

Samples are availabe e.g. if you select the mentioned function names in
the Object Browser (F2) and press F1 for help.
 
Here is a macro that I use here. It displays the notes if a single contact is
selected and also provides a text box to enter a new note for the contact (or
if multiple contacts are selected, adds the same note to all of the selected
contacts. This assumes that your already in the "Contacts" folder.


Sub AddOrReadContactNotes()

Dim myContactExp As Explorer
Set myContactExp = Application.ActiveExplorer
Select Case myContactExp.CurrentFolder.Name
'If you're not holding your contacts in the Contacts folder, you'll need
to change the name below to the name of the folder you're using for contact
items
Case "Contacts"
myUser = Application.Session.CurrentUser.Name
If myContactExp.Selection.Count > 1 Then
strNotes = "Enter contact note..."
myNote = InputBox(strNotes, "Add Note")
ElseIf myContactExp.Selection.Count = 1 Then
Set objItem = myContactExp.Selection(1)
strNotes = objItem.Body
strNotes = strNotes & vbCrLf & "Enter contact note..."
myNote = InputBox(strNotes, "Add/View Notes")
End If
If Not myNote = "" Then
For i = 1 To myContactExp.Selection.Count
Set objItem = myContactExp.Selection(i)
If objItem.Class = olContact Then
myBody = objItem.Body
objItem.Body = Now() & " - " & myUser & " - " & myNote &
vbCrLf & myBody
objItem.Save
End If
Next
End If
Set objItem = Nothing
End Select
Set myContactExp = Nothing

End Sub


For the Contacts in the current view (usually a category), I want a macro
that will 1) ask for a text input from the user; 2) precede the text with the
current date and time; then 3) append it to the Notes field of each Contact.
Or, I'd like info on a good substitute or add-in. Using Outlook2003, fully
updated, and XP Pro.

Any help appreciated.
 
Back
Top