Questions tagged «outlook-2003»

13
我可以在C#中读取Outlook(2003/2007)PST文件吗?
是否可以使用C#读取.PST文件?我想作为一个独立的应用程序,而不是作为Outlook插件(如果可能的话)来执行此操作。 如果看到其他 类似于此的SO 问题 ,请提及MailNavigator,但我希望以C#方式进行编程。 我查看了Microsoft.Office.Interop.Outlook命名空间,但这似乎仅用于Outlook加载项。LibPST似乎能够读取PST文件,但这是用C语言编写的(对不起,乔尔,我毕业之前没有学习C语言)。 任何帮助将不胜感激,谢谢! 编辑: 谢谢大家的答复!我接受了Matthew Ruston的回答作为答案,因为它最终使我明白了我要寻找的代码。这是我工作的一个简单示例(您将需要添加对Microsoft.Office.Interop.Outlook的引用): using System; using System.Collections.Generic; using Microsoft.Office.Interop.Outlook; namespace PSTReader { class Program { static void Main () { try { IEnumerable<MailItem> mailItems = readPst(@"C:\temp\PST\Test.pst", "Test PST"); foreach (MailItem mailItem in mailItems) { Console.WriteLine(mailItem.SenderName + " - " + mailItem.Subject); } } …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.