Hi.
When a person from one company shares their calendar to a person from another company, the shared calendar finally appears as a copy inside main calendar.
The same place where private calendars resign.
We need a way in c# code for outlook automation to distinguish such calendars.
Please see below c# code snipplet demonstrating the issue:
// use Microsoft.Office.Interop.Outlook.dll as ref to the project
using System;
using System.Runtime.InteropServices;
using Microsoft.Office.Interop.Outlook;
var outlookApp = new Microsoft.Office.Interop.Outlook.Application();
var ns = outlookApp.GetNamespace("MAPI");
var defaultCalendarFolder = ns.GetDefaultFolder(OlDefaultFolders.olFolderCalendar);
var foldersInsideDefaultFolder = defaultCalendarFolder.Folders;
for (int i = 1; i <= foldersInsideDefaultFolder.Count; i++)
{
MAPIFolder item = foldersInsideDefaultFolder[i];
Console.WriteLine($"Calendar: {item.Name}");
// how can we distinguish a private calendar from a shared one here ????????????
}