自动允许以编程方式访问Outlook

时间:2017-03-17 15:32:48

标签: python outlook exchange-server

企业交换服务器上存在公共共享文件夹。

我正在尝试连接到outlook文件夹,并监视它以接收传入邮件。

但是,当我连接时,我的本地Outlook实例会提示我许可。

无论如何都要绕过这个提示?

我尝试添加相关的MAPI注册表值,但它仍在提示。

有什么想法吗?

注册表我正在设置(python)

opened_key = winreg.CreateKey(winreg.HKEY_CURRENT_USER, r'SOFTWARE\Microsoft\Office\14.0\Outlook\Security')
winreg.SetValueEx(opened_key, 'PromptSimpleMAPISend', 0, winreg.REG_DWORD, 2)
winreg.SetValueEx(opened_key, 'PromptSimpleMAPINameResolve', 0, winreg.REG_DWORD, 2)
winreg.SetValueEx(opened_key, 'PromptSimpleMAPIOpenMessage', 0, winreg.REG_DWORD, 2)
winreg.SetValueEx(opened_key, 'PromptOomAddressBookAccess', 0, winreg.REG_DWORD, 2)
winreg.SetValueEx(opened_key, 'PromptOomFormulaAccess', 0, winreg.REG_DWORD, 2)
winreg.SetValueEx(opened_key, 'PromptOomSaveAs', 0, winreg.REG_DWORD, 2)

winreg.SetValueEx(opened_key, 'PromptOomAddressInformationAccess', 0, winreg.REG_DWORD, 2)
winreg.SetValueEx(opened_key, 'PromptOomMeetingTaskRequestResponse', 0, winreg.REG_DWORD, 2)
winreg.SetValueEx(opened_key, 'PromptOomSend', 0, winreg.REG_DWORD, 2)

winreg.CloseKey(opened_key)

1 个答案:

答案 0 :(得分:1)

如果您在阅读MailItem.Body属性时收到提示,则您的变通方法会列在http://www.outlookcode.com/article.aspx?id=52

上面的注册表项无效。您的选项是扩展MAPI(仅限C ++或Delphi),MAPI包装器,如Redemption(可以从Python访问)或像ClickYes这样的应用程序。

相关问题