Microsoft KB Archive/246616: Difference between revisions

From BetaArchive Wiki
m (Text replacement - ">" to ">")
m (Text replacement - """ to """)
 
Line 64: Line 64:
If possible, use Outlook Object model to send such meeting requests. The following Microsoft Visual Basic code demonstrates how to do this using the Outlook Object Model:
If possible, use Outlook Object model to send such meeting requests. The following Microsoft Visual Basic code demonstrates how to do this using the Outlook Object Model:
<pre class="codesample">'To run the code, please have a reference to Microsoft Outlook Object library from your Visual Basic project.
<pre class="codesample">'To run the code, please have a reference to Microsoft Outlook Object library from your Visual Basic project.
Set objOlApp = CreateObject(&quot;Outlook.Application&quot;)
Set objOlApp = CreateObject("Outlook.Application")
Set objNamespace = objOlApp.GetNamespace(&quot;MAPI&quot;)<BR/>
Set objNamespace = objOlApp.GetNamespace("MAPI")<BR/>
objNamespace.Logon
objNamespace.Logon
Set objFolder = objNamespace.GetDefaultFolder(olFolderCalendar)
Set objFolder = objNamespace.GetDefaultFolder(olFolderCalendar)
Set objItems = objFolder.Items
Set objItems = objFolder.Items
Set objItem = objItems.Add(&quot;IPM.Appointment.CustomAppointmentItem&quot;) 'TO DO:Please replace the message class in parenthesis with your custom AppointmentItem's message class
Set objItem = objItems.Add("IPM.Appointment.CustomAppointmentItem") 'TO DO:Please replace the message class in parenthesis with your custom AppointmentItem's message class


objItem.MeetingStatus = 1 'olMeeting
objItem.MeetingStatus = 1 'olMeeting
objItem.Subject = &quot;Strategy Meeting&quot;
objItem.Subject = "Strategy Meeting"
objItem.Start = #12/27/99 1:30:00 PM#  
objItem.Start = #12/27/99 1:30:00 PM#  
objItem.Duration = 90
objItem.Duration = 90
Set objRequiredAttendee = objItem.Recipients.Add(&quot;A recipient name goes here&quot;)
Set objRequiredAttendee = objItem.Recipients.Add("A recipient name goes here")
objItem.Send
objItem.Send
                 </pre>
                 </pre>

Latest revision as of 13:50, 21 July 2020

Knowledge Base


PRB: CDO Can't Send Meeting Requests Based on Custom AppointmentItems

Article ID: 246616

Article Last Modified on 3/4/2004



APPLIES TO

  • Microsoft Collaboration Data Objects 1.2
  • Microsoft Collaboration Data Objects 1.21



This article was previously published under Q246616

SYMPTOMS

When you use CDO (1.2 or 1.21) to programmatically create a MeetingItem from a customized AppointmentItem, and send it to a recipient, the recipient gets a meeting request with a standard AppointmentItem in it. Accepting the meeting request saves a standard AppointmentItem into the recipient's calendar.

Please note that in this scenario, CDO (1.2 or 1.21) doesn't produce any error message when you send the MeetingItem.

CAUSE

This is a design limitation of CDO (1.2 or 1.21) library. It doesn't support sending meeting requests based on custom AppointmentItems.


RESOLUTION

If possible, use Outlook Object model to send such meeting requests. The following Microsoft Visual Basic code demonstrates how to do this using the Outlook Object Model:

'To run the code, please have a reference to Microsoft Outlook Object library from your Visual Basic project.
Set objOlApp = CreateObject("Outlook.Application")
Set objNamespace = objOlApp.GetNamespace("MAPI")<BR/>
objNamespace.Logon
Set objFolder = objNamespace.GetDefaultFolder(olFolderCalendar)
Set objItems = objFolder.Items
Set objItem = objItems.Add("IPM.Appointment.CustomAppointmentItem") 'TO DO:Please replace the message class in parenthesis with your custom AppointmentItem's message class

objItem.MeetingStatus = 1 'olMeeting
objItem.Subject = "Strategy Meeting"
objItem.Start = #12/27/99 1:30:00 PM# 
objItem.Duration = 90
Set objRequiredAttendee = objItem.Recipients.Add("A recipient name goes here")
objItem.Send
                

Keywords: kbmsg kbprb KB246616