Outlook 2007联系人访问警告

时间:2010-10-17 11:46:07

标签: outlook office-interop

我正在尝试使用以下代码从Outlook(2007)获取联系人:

Outlook.Application outlookApp = new Outlook.Application();
Outlook.MAPIFolder fldContacts = outlookApp.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts) as Outlook.MAPIFolder;
foreach (Outlook._ContactItem contact in fldContacts.Items) {...}

问题是当我尝试获取电子邮件地址时,我收到来自Outlook的警告,如下所示:

A program is trying to access e-mail address information stored in Outlook.
If this is unexpected, click Deny and verify your antivirus software is up-to-date.
For more information about e-mail safety and how you might be able to avoid getting this warning, click Help.

我希望用户拥有干净的体验(此提取用于根据邮件地址向应用程序添加新朋友)。 Skype设法在没有Outlook要求用户批准的情况下这样做。到目前为止,谷歌叔叔发现的解决方案大多是肮脏的黑客,我想知道是否有一个干净的方法来做到这一点。

想法?

1 个答案:

答案 0 :(得分:1)

避免Outlook警告的一种很好的干净方法是使用Add-in Express's Outlook Security Manager。它真的很容易使用:

SecurityManager.DisableOOMWarnings = true; 
相关问题