How to convert .doc file to .txt in Python

subhabrata.banerji at gmail.com subhabrata.banerji at gmail.com
Thu Apr 9 12:50:16 CEST 2015


On Thursday, April 9, 2015 at 3:56:09 PM UTC+5:30, subhabrat... at gmail.com wrote:
> Dear Group,
> 
> I was trying to convert .doc file to .txt file. 
> 
> I got of python-docx, zipfile but they do not seem to help me much. 
> 
> You may kindly suggest how to convert from .doc to .docx/.html/.pdf/.rtf as from them I am being able to convert to .txt. 
> 
> If any one of the Python experts may kindly help me. 
> 
> Regards,
> Subhabrata Banerjee.

I could do one it seems running with 
>>> import win32com.client as win32
>>> word = win32.Dispatch("Word.Application")
>>> word.Visible = 0
>>> word.Documents.Open("/python27/Document1.doc")
<COMObject Open>
>>> doc = word.ActiveDocument

seems working. You may suggest better. 



More information about the Python-list mailing list