View Single Post
  #3  
Old October 12th 07, 11:48 PM posted to microsoft.public.outlook.program_vba
Dan Mitchell
external usenet poster
 
Posts: 58
Default Sending an Outlook Appointment via CDO

"Steve Ricketts" wrote in
:
I'd like to send an appointment request with CDO in Visual Basic. I
can find lots of examples of sending mail, but none of an appointment
request. I'm not even sure if this is the right forum.


If you mean CDO1.21 (rather than CDOSYS as in your other post), then
something like this:

Dim s As New MAPI.session
s.Logon "profilename"

Dim f As MAPI.Folder
Set f = s.GetDefaultFolder(CdoDefaultFolderCalendar)

Dim ai As MAPI.AppointmentItem
Set ai = f.Messages.Add
ai.Subject = "test"
ai.Text = "hello"
ai.StartTime = Now
ai.EndTime = Now + 1

Dim r As MAPI.Recipient
Set r = ai.Recipients.Add
r.Name = "someoneelse"
r.Type = CdoTo
r.Resolve

ai.MeetingStatus = CdoMeeting
ai.Send

Also, this is for Outlook Object Model code; sending an appointment
that way would be different.

-- dan
Ads