Tag: outlook 2003

我可以在C#中读取Outlook(2003/2007)PST文件吗?

是否有可能使用C#读取.PST文件? 我想做一个独立的应用程序,而不是作为一个Outlook插件(如果可能的话)。 如果看到其他 类似这样的问题提到MailNavigator,但我期待以编程方式在C#中执行此操作。 我已经看了Microsoft.Office.Interop.Outlook命名空间,但似乎只是为Outlook插件。 LibPST似乎能够读取PST文件,但这是在C(对不起,乔尔,我没有学过C之前,gradle )。 任何帮助将不胜感激,谢谢! 编辑: 谢谢大家的回应! 我接受了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); } } catch (System.Exception […]