【问题标题】:Automatically Allow Programmatic Access to Outlook自动允许以编程方式访问 Outlook
【发布时间】:2022-04-28 09:09:25
【问题描述】:

公司 Exchange 服务器上存在一个公共共享文件夹。

我正在尝试连接到 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)

【问题讨论】:

  • 代码的哪一行引发了提示?请参阅outlookcode.com/article.aspx?id=52 了解您的选项列表。
  • 当我尝试并实际访问文件夹中的项目时,提示实际上是在其他地方提出的
  • 我明白这一点。不过,它是什么?
  • 当你尝试访问item.Body时会提示没有检查item.Subjet的提示

标签: python outlook exchange-server


【解决方案1】:

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

上面的注册表项不会做任何事情。您可以选择扩展 MAPI(仅限 C++ 或 Delphi)、MAPI 包装器,例如 Redemption(我是它的作者 - 可以通过 Python 访问兑换)或 ClickYes 之类的应用程序。

【讨论】:

  • 赎回工作中,感谢您的指导。必须安装 32 位版本的 python 才能使其与在 64 位 PC 上运行的 32 位 Outlook 实例一起工作-_-
猜你喜欢
  • 2021-07-09
  • 1970-01-01
  • 2011-01-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-07-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多