我使用compypespython3.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)发布于 2017-09-19 09:55:23
我求助于使用在这个thread中所做的方法,而不是在我的问题上测试什么。
https://stackoverflow.com/questions/46145682
复制相似问题