问题
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