2012-09-11 34 views
0

可能重复:
Connect to Outlook calendar from C# using Interop如何使用C#访问Outlook用户的日历?

我要访问一个Outlook用户的日历约会,考虑到用户的电子邮件地址。

这大概涉及到以某种方式使用Microsoft.Office.Interop.Outlook.NameSpace对象到达用户的日历。

+0

这里看看http://stackoverflow.com/问题/ 90899/net-get-all-outlook-calendar-items – opewix

+0

也许这些会有所帮助 - http://stackoverflow.com/questions/9216064/connect-to-outlook-calendar-from-c-sharp-using-interop和http://stackoverflow.com/questions/9217396/how-do-i-add-a-new-meeting-request-to-an-outlook-calendar-using-interop – JMK

+0

@JesseJames,这是一个不同的问题。谢谢。 – mackenir

回答

5

这里是由打开特定用户的日历,从张贴在关于这个问题的意见的问题采取JMK具体的代码片段:

string userName = "Foo bar"; 

Outlook.Application oApp; 
oApp = new Outlook.Application(); 
Outlook.NameSpace oNS = oApp.GetNamespace("mapi"); 
oNS.Logon(Missing.Value, Missing.Value, true, true); 

Outlook.Recipient oRecip = (Outlook.Recipient)oNS.CreateRecipient(userName); 
Outlook.MAPIFolder usersCalendarFolder = (Outlook.MAPIFolder) oNS.GetSharedDefaultFolder(oRecip, Outlook.OlDefaultFolders.olFolderCalendar); 
相关问题