View Single Post
  #4  
Old June 10th 09, 02:09 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default add new atendee to an existing appointment

There's no error handling in this and it's just a basic example that assumes
that whatever is selected is actually an appointment item. The code also
assumes it's running in the Outlook VBA project.

Sub AddRecip()
Dim oAppt As Outlook.AppointmentItem
Dim colRecips as Outlook.Recipients
Dim oRecip As Outlook.Recipient

Set oAppt = Application.ActiveExplorer.Selection.Item(1)
Set colRecips = oAppt.Recipients
Set oRecip = colRecips.Add(Application.Session.CurrentUser.Addr ess)
oRecip.Type = olTo

oAppt.Save

Set oRecip = Nothing
Set colRecips = Nothing
Set oAppt = Nothing
End Sub

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Andrew" wrote in message
...
Hi Ken

Unfortuanly i am very limited in my understanding of the VBA Scripting
could
you please show me te example of what you mean.

Thank you for your time

Andrew


Ads