0

I'm using comptypes python 3.6 and trying read office documents as i need to extract the text from these files.

I understand that for word and ppt this is how to open files using comtype

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

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

How about for Outlook files (.msg)? I tried the following code but doesn't work

ol = comtypes.client.CreateObject('Outlook.Application')
msg = ol.MailItem.Open(filename)
mtryingtocode
  • 939
  • 3
  • 13
  • 26

1 Answers1

1

I've resorted in using the approach done in this thread instead of what I was testing out on my question.

mtryingtocode
  • 939
  • 3
  • 13
  • 26