Outlook 2013 VSTO:确定 AppointmentItem 在哪个日历上?

Outlook 2013 VSTO: Determine which calendar an AppointmentItem is on?

In Outlook 2013 in Calendar view, when an AppointmentItem is selected, I need to be able to determine if that item is on the current user's Calendar, or if they have selected an item from someone else's shared calendar.因此,如果 John Doe 是当前用户,我需要检查所选约会是在 John 的日历上,还是在其他人的日历上。 (如果他们在别人的日历上选择了一个项目,我需要禁用我的功能区上的一个按钮) 我该如何检查?

关键是通过 Application.ActiveExplorer 从 Explorer.CurrentFolder 获取文件夹对象。共享文件夹的 Folder.EntryID 值将在 Folder.FolderPath 中重复,而非共享文件夹将具有实际的文件夹路径值。

如果您想获得对共享文件夹的正确引用,也可以使用 NameSpace.GetSharedDefault。