FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Converting Microsoft .Docx to .txt
Posts: 56
Joined: Mon Jul 03, 2006 02:34 AM
Converting Microsoft .Docx to .txt
Posted: 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

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Converting Microsoft .Docx to .txt
Posted: Thu Jan 17, 2008 08: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

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Converting Microsoft .Docx to .txt
Posted: Thu Jan 17, 2008 08:19 AM

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

How to: Manipulate Office Open XML Formats Documents

Continue the discussion