简体   繁体   English

C#关闭共享的Outlook日历

[英]C# close a shared outlook calendar

I wrote a tool to read appointments of shared folders. 我写了一个工具来读取共享文件夹的约会。 After that I have a lot of shared calendar folder inside my calendar view in outlook. 之后,我的Outlook日历视图中有很多共享日历文件夹。

No I want to remove/close/disconnect the shared calender. 否,我想删除/关闭/断开共享日历。

I used this solution to open the shared calender: Connect to Outlook calendar from C# using Interop 我使用以下解决方案打开了共享日历: 使用Interop从C#连接到Outlook日历

But how can I remove/close/disconnect it? 但是如何删除/关闭/断开连接呢?

I tested the .Delete() operation, but I think this will delete the calendar from the sharing user and thats not my plan. 我测试了.Delete()操作,但是我认为这将从共享用户中删除日历,这不是我的计划。

Hope somebody can help me! 希望有人能帮助我!

Thanks 谢谢

You need to use the to use the Remove method of the NavigationFolder class for shared calendars, not Folder.Delete. 您需要使用,将NavigationFolder类的Remove方法用于共享日历,而不是Folder.Delete。 Here is what MSDN states: 这是MSDN声明的内容:

Only removable folders, NavigationFolder objects with an IsRemovable property value set to True, can be removed from a NavigationFolders collection. 只能从NavigationFolders集合中删除可移动文件夹,即将IsRemovable属性值设置为True的NavigationFolder对象。 This means that you can use NavigationFolders.Remove to remove shared folders, public folders, and linked folders. 这意味着您可以使用NavigationFolders.Remove删除共享文件夹,公用文件夹和链接的文件夹。

See How to: Enumerate Active Folders in the Calendar View for more information. 有关更多信息,请参见如何:在日历视图中枚举活动文件夹

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM