Outlook电子邮件转pdf安全提示 [英] Outlook email to pdf security prompt
问题描述
我有一个任务,我需要创建一个将Outlook电子邮件转换为pdf的程序.
I have a task which i need to create a program that converts outlook email to pdf.
这是我的代码
Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application();
NameSpace outlookNs = app.GetNamespace("MAPI");
MAPIFolder rootFolder = outlookNs.Stores["Blah"].GetRootFolder();
List<MailItem> mailItems = new List<MailItem>();
Folders subFolders = rootFolder.Folders;
foreach (Folder folder in subFolders)
{
if (folder.Name == "Inbox")
{
Items items = folder.Items;
foreach (object item in items)
{
if (item is MailItem)
{
MailItem mailItem = item as MailItem;
string fileName = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "New folder", mailItem.EntryID + mailItem.SenderName.Replace("/", "") + ".msg");
mailItem.SaveAs(fileName, Microsoft.Office.Interop.Outlook.OlSaveAsType.olMSG);
}
}
}
}
该代码正在运行,但是前景包含成千上万的电子邮件.Outlook每隔10分钟会提示一条消息,类似于下面的屏幕截图
the code is working but the outlook contains thousands of email. The outlook prompt a message every 10 minutes similar to the screenshot below
是否有避免收到消息的方法?以编程方式或设置会做什么?
is there a way to avoid getting the message? Programatically or a setting will do?
推荐答案
请参见 http://www.outlookcode.com/article.aspx?id=52 以获得您的选项列表.
See http://www.outlookcode.com/article.aspx?id=52 for the list of your options.
从本质上讲,您可以确保计算机上的防病毒应用程序是最新的,也可以使用类似兑换以保存MSG文件.
Essentially, you can either make sure that the antivirus app on your machine is up to date or use a library like Redemption to save the MSG files.
这篇关于Outlook电子邮件转pdf安全提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!