Calendar Folders and the CDO object model 
Author Message
 Calendar Folders and the CDO object model

My question concerns the CDO object model.  (See the code below.)  When I
use the cdoSession.GetDefaultFolder method, I get a MAPI.Folder object.
When I navigate the InfoStores as below, I get a MAPI.Folder object.  When I
compare the folders, they are identical.  However, when I create a new item
in the cdoDefCalendar folder, it is a MAPI.Appointment object, but when I
create a new item in the cdoCalendar folder, it is a MAPI.Message object.
This occurs even when I use intermediate variables for the collections.  Can
anyone explain why this happens?

Thanks,
Pete Anfinsen

' First MAPI.Folder object
Set cdoDefCalendar = cdoSession.GetDefaultFolder(cdoDefaultFolderCalendar)
' Second MAPI.Folder object
For each cdoIS in cdoSession.InfoStores
    For each cdoFolder in cdoIS.RootFolder.Folders
        If cdoFolder.Name = "Calendar" then Set cdoCalendarFolder =
cdoFolder
    Next
Next
' Compare them
If cdoDefCalendar.IsSameAs(cdoCalendar) then
    msgbox "They're the same."    ' msg displays
End If
' Add message to first
Set cdoDefAppt = cdoDefCalendar.Messages.Add
msgbox cdoDefAppt.Class    ' 26 => MAPI.AppointmentItem
' Add message to second
Set cdoAppt = cdoCalendar.Messages.Add
msgbox cdoAppt.Class    ' 3 => MAPI.Message



Sat, 19 Apr 2003 05:21:09 GMT  
 Calendar Folders and the CDO object model
This makes at least some sense if you consider that the MAPI.Appointment
object functions only in the current session's default Calendar folder.

--
Sue Mosher
Author of
  "Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours"
  "Microsoft Outlook 2000 E-mail and Fax Guide"

Outlook and Exchange solutions at http://www.slipstick.com


Quote:
> My question concerns the CDO object model.  (See the code below.)  When I
> use the cdoSession.GetDefaultFolder method, I get a MAPI.Folder object.
> When I navigate the InfoStores as below, I get a MAPI.Folder object.  When
I
> compare the folders, they are identical.  However, when I create a new
item
> in the cdoDefCalendar folder, it is a MAPI.Appointment object, but when I
> create a new item in the cdoCalendar folder, it is a MAPI.Message object.
> This occurs even when I use intermediate variables for the collections.
Can
> anyone explain why this happens?

> Thanks,
> Pete Anfinsen

> ' First MAPI.Folder object
> Set cdoDefCalendar = cdoSession.GetDefaultFolder(cdoDefaultFolderCalendar)
> ' Second MAPI.Folder object
> For each cdoIS in cdoSession.InfoStores
>     For each cdoFolder in cdoIS.RootFolder.Folders
>         If cdoFolder.Name = "Calendar" then Set cdoCalendarFolder =
> cdoFolder
>     Next
> Next
> ' Compare them
> If cdoDefCalendar.IsSameAs(cdoCalendar) then
>     msgbox "They're the same."    ' msg displays
> End If
> ' Add message to first
> Set cdoDefAppt = cdoDefCalendar.Messages.Add
> msgbox cdoDefAppt.Class    ' 26 => MAPI.AppointmentItem
> ' Add message to second
> Set cdoAppt = cdoCalendar.Messages.Add
> msgbox cdoAppt.Class    ' 3 => MAPI.Message



Sat, 19 Apr 2003 07:13:16 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Accessing calendar from offline folder (MAPI, CDO, outlook object model..?????)

2. Accessing calendar from offline folder (MAPI, CDO, outlook object model..?????)

3. Outlook Object Model and CDO

4. CDO vs. Outlook Object Model

5. Outlook Object Model or CDO

6. Report Object Model/Viewer Object Model

7. Access folder ACL via Outlook object model?

8. Recurse Folders using Outlook Object Model?

9. Accessing Personal and Public folders via CDO object

10. Object could not be found , Calendar folder

11. Seeking CDO object reference with correlated CDO PropTags / constants

12. Seeking CDO object reference with correlated CDO PropTags / constants

 

 
Powered by phpBB® Forum Software