【问题标题】:Python comtypes read Outlook filePython comtypes 读取 Outlook 文件
【发布时间】:2018-02-19 02:29:46
【问题描述】:

我正在使用 comptypes python 3.6 并尝试阅读 office 文档,因为我需要从这些文件中提取文本。

我知道对于 word 和 ppt,这是使用 comtype 打开文件的方法

word = comtypes.client.CreateObject('Word.Application')
doc = word.Documents.Open(filename)

ppt = comtypes.client.CreateObject('PowerPoint.Application')
prs = ppt.Presentations.Open(filename)

Outlook 文件 (.msg) 怎么样?我尝试了以下代码但不起作用

ol = comtypes.client.CreateObject('Outlook.Application')
msg = ol.MailItem.Open(filename)

【问题讨论】:

    标签: python comtypes


    【解决方案1】:

    我使用了thread 中的方法,而不是我在我的问题上测试的方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-13
      • 1970-01-01
      • 1970-01-01
      • 2018-10-27
      • 2022-07-14
      • 2021-02-12
      • 1970-01-01
      相关资源
      最近更新 更多