How do you set contacts for appointments and journal items?
Printable View
How do you set contacts for appointments and journal items?
You need to add a contact as a receipient of the appointment item.
VB Code:
oApptItem.Recipients.Add ("RobDog888")
do I need to create a recipient object?
BTW I am doing this with VBA
I am not sure if I am on the right track. I am confused when it comes to the "recipients" collection and "recipient" object when it relates to a journal item.
I tried to create a recipient object and add it to the journal item, but it did not work. The contacts field was empty when I opened the item in the Outlook UI.
VB Code:
Private Sub CreateJournalItem() Dim objappitm As Outlook.JournalItem Dim objRecip As Outlook.Recipient Set objappitm = Outlook.CreateItem(olJournalItem) Set objRecip = objappitm.Recipients.Add(cboContact.text) objappitm.Companies = "Acme" objappitm.Subject = txtSubject.Text objappitm.Type = "Phone Call" & " (reveived)" objappitm.Start = txtDate.Text & " " & txtTime.Text objappitm.Duration = 30 objappitm.Recipients.Add objRecip objappitm.Save End Sub
what's wrong with this code?
thanks for the help
I tried what you posted, but there is nothing in the contacts field for any example I try.
For the ContactItem you also need to do a .Recipients.ResolveAll
Contact item?