none
How to get Recurring Meeting parent or MAPI Folder RRS feed

  • Question

  • Hi

    I want to get MAPIFolder of a Recurring Meeting Occurance. I will discribe the things that i need.

    I have a recurring meeting having 5 occurances. If i open the recurring meeting as "Open the serious"  the following code is working

    MAPIFolder folder = (MAPIFolder)meeting.Parent; 

    If i Open this Occurance that code is not working. I'm getting the following error

    Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.MAPIFolder'. This operation failed because the QueryInterface call on the COM component for the interface with IID 

    '{00063006-0000-0000-C000-000000000046}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

    Is there any idea to get that MAPIFolder ?

    Thanks

    Bobbin

    Thursday, May 31, 2012 1:23 PM

Answers

  • if ((meeting.RecurrenceState == OlRecurrenceState.olApptOccurrence) or (meeting.RecurrenceState == OlRecurrenceState.olApptException))
    {
       folder = ((AppointmentItem)meeting.Parent).Parent;
    }
    else
    {
        folder = meeting.Parent;
    }


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Thursday, May 31, 2012 4:40 PM

All replies

  • parent of recurring item is a master item - detect this by checking RecurrenceState property. So to get folder from exception or occurence is to get parent (master item) and then parent of master item.
    Thursday, May 31, 2012 1:30 PM
  • Hi

    Can you post the code to find the master recurring metting

    Thursday, May 31, 2012 4:18 PM
  • if ((meeting.RecurrenceState == OlRecurrenceState.olApptOccurrence) or (meeting.RecurrenceState == OlRecurrenceState.olApptException))
    {
       folder = ((AppointmentItem)meeting.Parent).Parent;
    }
    else
    {
        folder = meeting.Parent;
    }


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Thursday, May 31, 2012 4:40 PM