Automatically Allow Programmatic Access to Outlook

流过昼夜 提交于 2020-01-06 18:16:03

问题


There is a Public Shared Folder that exists on a corporate exchange server.

I am trying to connect to the outlook folder, and monitor it for incoming mail.

However, When I connect, my local instance of Outlook prompts me for permission.

Is there anyway to circumvent this prompt?

I tried adding relevant MAPI registry values, but it is still prompting.

Any thoughts?

Registry I am setting (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:


If you get prompt when reading the MailItem.Body property, your workarounds are listed at http://www.outlookcode.com/article.aspx?id=52.

The registry keys above will do nothing. Your options are Extended MAPI (C++ or Delphi only), MAPI wrapper such as Redemption (which can be accessed form Python) or an app like ClickYes.



来源:https://stackoverflow.com/questions/42861540/automatically-allow-programmatic-access-to-outlook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!