使用 Python 打开 Outlook
我正在尝试使用 Python 打开 Outlook,我得到了这个...
import win32com.client
ol = win32com.client.Dispatch("outlook.Application")
它打开了 Outlook,但我的问题是它在 Windows 的通知区域(时钟所在的位置)中打开它,但它不会在屏幕上打开它。我尝试了...
OL.visible= True
但收到错误消息,指出 Outlook 应用程序无法设置为可见。所以我的问题是如何将 Outlook 设为全屏或将其最大化至全屏?
I am trying to open Outlook with Python and I got this...
import win32com.client
ol = win32com.client.Dispatch("outlook.Application")
It opens Outlook but my probles is it opens it in the notification area of Windows (where the clock is) and it doesn't open it up on the screen. I tried a ...
OL.visible= True
But I get an error that Outlook application can't be set to visible. So my question is how can I bring Outlook for, or maximze it to a full screen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好吧,我发现这个工作起来很简单......
它使它成为一个大窗口,而不是一个最小化的窗口。
Ok I found this to work as simple as it was....
It makes it into a large window and mot a minimized one.
您见过这个问题吗?解决方案是从 shell 命令启动 Outlook,然后附加到正在运行的进程。这看起来很脏,但出于绝望,我对其他程序也做了同样的事情。我希望 MS Office 能够更好地与 COM 配合使用。
我想知道您是否可以执行类似于 MS 示例的操作
我没有安装 Outlook,所以无法测试任何内容。
Have you seen this SO question? The solution there was to start up Outlook from a shell command and then attach to the running process. It seems dirty, but I've done the same with other programs out of desperation. I would expect MS Office to play nicer with COM.
I wonder if you could do something similar to the MS example here.
I don't have Outlook installed so I can't test anything.
您还可以使用 psutil 检查 Outlook 是否正在运行
You could also check if Outlook is running using psutil