1

I know this question has been sort of asked, but I have a specific issue which I haven't found the answer for. I am trying to open a shared calendar from another user and his/her calendar is NOT their default calendar.

I have tried the following:

    var ns = Globals.ThisAddIn.Application.Session;

    var recip = ns.CreateRecipient("me@me.com");
    if (recip.Resolve())
    {
      var sharedCal = ns.GetSharedDefaultFolder(recip, Outlook.OlDefaultFolders.olFolderCalendar);
    }

This just does not work.

I can see the shared calendar by doing the following

private void GetCalendars()
        {

            Outlook.CalendarModule calModule = (Outlook.CalendarModule)this.Application.ActiveExplorer().NavigationPane.Modules.GetNavigationModule(Outlook.OlNavigationModuleType.olModuleCalendar);


            foreach (Outlook.NavigationGroup group in calModule.NavigationGroups)

            {
                Debug.WriteLine("Calandar Folders Group  >>>>" + group.Name);


                foreach (Outlook.NavigationFolder folder in group.NavigationFolders)
                {

                    Debug.WriteLine("Calandar Folders:  >>>>" + folder.DisplayName);

                }
            }
        }

I just don't know how to open the calendar once I have the name. There is no way to get the ID using the steps above

In outlook, the calendar exists in the "Shared Calendars" navigation tree.

I am looking for a way to get the names of the Shared Calendars and then having the user select the shared calendar (E.g. From a dropdown box) and then opening that calendar.

I have found code on how to do everything else but not that specifically!

Can someone point me in the right direction??

Thanks!!

MrTouya
  • 656
  • 6
  • 19

1 Answers1

0

You cannot access that folder using the Outlook Object Model.

For a cached Exchange mailbox, the folders are cached n the primary mailbox's OST file. On the Extended MAPI level (C++ or Delphi), the folders are stored outside of the IPM tree visible to the end user. You can see the data in OutlookSpy (I am its author) - click IMsgStore | Open Root Folder | GetHierarchyTable | double click on the "Shared Data" folder | GetHierarchyTable | etc.

You can open that folder using Redemption (I am also its author - start with RDOStore.RootFolder). You can also open the online mailbox of another user using RDOSession.GetSharedMailbox and navigate to the folder in question starting with RDOStore.IPMRootFolder (returns top level folders visible to the user in that mailbox).

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78