gpt4 book ai didi

c# - Exchange Web 服务和 C# : How to get appointments from shared calendar

转载 作者:太空宇宙 更新时间:2023-11-03 17:05:52 24 4
gpt4 key购买 nike

我正在尝试获取共享日历上当天所有约会的列表。我已经成功地为与我的用户帐户绑定(bind)的我自己的日历完成了它。我尝试获取共享日历的 folderId,但找不到。

我用它通过它的 folderId 访问我的日历并且它有效:

Console.WriteLine("Listing appointments...");
//open the calendar
CalendarFolder calendar = CalendarFolder.Bind(service, WellKnownFolderName.Calendar);

//query for appointments in next 10 days
//FindItemsResults<Appointment> appointments = calendar.FindAppointments(new CalendarView(DateTime.Now, DateTime.Now.AddDays(10)));

//find appointments and write out subject
foreach (Appointment appointment in service.FindItems(new FolderId("FOLDERIDHERE"), new ItemView(int.MaxValue)))
Console.WriteLine(appointment.Subject);

我不知道这是否可以访问共享文件夹,我也不知道共享文件夹的文件夹 ID。

最佳答案

你可以尝试这样的事情:

        CalendarModule calModule = (CalendarModule)this.Application.ActiveExplorer().NavigationPane.Modules.GetNavigationModule(OlNavigationModuleType.olModuleCalendar);
foreach (NavigationGroup group in calModule.NavigationGroups)
{
NavigationFolders folders = group.NavigationFolders;
MAPIFolder OtherFolder = null;
Items OtherFolderItems = null;

for (int i = 1; i <= group.NavigationFolders.Count; i++)
{
OtherFolder = folders[i].Folder; //This does not work for me
OtherFolderItems = OtherFolder.Items;
}

不幸的是,这段代码对我不起作用,因为尝试访问 .Folder 会引发异常。我在这个链接上找到了这个:http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/4891d3a5-f578-495c-83aa-f5a914474c78/

关于c# - Exchange Web 服务和 C# : How to get appointments from shared calendar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16443313/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com