代码之家  ›  专栏  ›  技术社区  ›  Eldad Mor

Outlook 2007联系人访问警告

  •  0
  • Eldad Mor  · 技术社区  · 15 年前

    我正在尝试使用以下代码从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 回复  |  直到 12 年前
        1
  •  1
  •   BenMorel Manish Pradhan    12 年前

    一个避免Outlook警告的好方法是使用 Add-in Express's Outlook Security Manager . 它非常容易使用:

    SecurityManager.DisableOOMWarnings = true;