Python olefile extract text of body

1.7k Views Asked by At

I been trying to extract the text content of a msg file in the disk using python module olefile. But getting AttributeError: OleFileIO instance has no attribute 'read'. Tried to read olefile API but could not get any clue. Thank you.

import sys,olefile

x=olefile.OleFileIO('dkd.msg')

print x.read()
1

There are 1 best solutions below

0
On BEST ANSWER

Try

y = x.openstream('WordDocument'); print y.read()