Sending an Outlook Appointment via CDO

  • Thread starter Ken Slovak - [MVP - Outlook]
  • Start date
K

Ken Slovak - [MVP - Outlook]

CDO 1.21 will fire the security prompts. You have to set
AppointmentItem.MeetingStatus to 1 (olMeeting) plus set any required and
optional attendees. Required are olTo (1), optional are olCC (2) and
Resources are olBCC (3). Then after you set the other required properties
you call send. The appointment has to be created in the default Calendar
folder for CDO to recognize it as an appointment.

You'd be better off using the Outlook object model although you'd still get
security warnings if you weren't running in a COM addin or using a security
bypass.
 
D

Dan Mitchell

Steve Ricketts said:
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
 
S

Steve Ricketts

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.

Could anyone point me in the right direction for either (1) how to send an
appointment request or (2) the proper forum for a request like this.

Thanks very much,

Steve
 
S

Steve Ricketts

Many thanks to both you and Ken!

I was able to use iCalendar in CDOSYS and xp_sendMail but this is a very
interesting approach. I'll give it a go too!

Thanks again for all your help.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top