Converting Microsoft .Docx to .txt

Converting Microsoft .Docx to .txt

Postby Colin Wisbey » Wed Jan 16, 2008 11:28 pm

As I understand it, MS Office 2007 replaces .DOC format with .DOCX

I have a routine (per Enrico) to convert a .DOC file to a text file (.TXT) as follows:
-------
LOCAL oWord := CREATEOBJECT( "Word.Application" )
LOCAL oDoc := oWord:Documents:Open( "e:\xharbour\test.doc" )
oDoc:SaveAs( "e:\MyDir\NewDocument.txt", wdFormatDOSText )
oWord:Quit()
------
Works great.

I don't have Office 2007 so can anyone tell me what change I have to make to the above to programatically convert a .DOCX file to a text file (.TXT)?

TIA
Col
Colin Wisbey
 
Posts: 56
Joined: Mon Jul 03, 2006 2:34 am

Postby Otto » Thu Jan 17, 2008 8:11 am

Not a real solution - more to see how word 2007 works:
rename docx to zip – open the zip file - search for document.xml – search for the <w:t>here is the TXT (</w:t>
Regards,
Otto
User avatar
Otto
 
Posts: 6327
Joined: Fri Oct 07, 2005 7:07 pm

Postby Otto » Thu Jan 17, 2008 8:19 am

http://msdn2.microsoft.com/en-us/library/aa982683.aspx

How to: Manipulate Office Open XML Formats Documents
User avatar
Otto
 
Posts: 6327
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 87 guests