Sucking strings outa a word doc

Miscellaneous Forums/General Discussion/Sucking strings outa a word doc

anyone had the chance to auot-convert a word doc to notepad via code in order to manipulate the resultant text file programmitcally ? Just wondered........

You shold try the ODF document instead. they are open and you will not commit crime :)

Which format? .doc or .docx?

You'd probably be better off using a VBA for Word script to do this.

@wings. what crime would he be commiting?

@blitzplotter I think it has been mentioned that word basicly uses its file format for a memory dump so good luck sifting through those 1's and 0's!

A little off topic, but quite interesting: If you decompress a 2007 document (e.g. docx) using a standard decompression tool like IZARC or similar it will leave you with a full XML document structure. This leads me to conclude that all the 2007 formats are just zipped XML files making Office 2007 docs actually pretty open and readable in lots of ways.

Oh and deciphering a data format is in NO WAY illegal, and storing your data in proprietry format isn't either. As long as it's YOUR data you can store it however you like.

Darkheart

This leads me to conclude that all the 2007 formats are just zipped XML files

Funny that...

:-)

@DarkHeart, thanks, thats interesting and good food for thought.

VBA for word script also sounds an interesting option, thanks big10p.

ehem ehem....
http://msdn.microsoft.com/en-us/library/aa338205.aspx

A little off topic, but quite interesting: If you decompress a 2007 document (e.g. docx) using a standard decompression tool like IZARC or similar it will leave you with a full XML document structure. This leads me to conclude that all the 2007 formats are just zipped XML files making Office 2007 docs actually pretty open and readable in lots of ways.


They are... The 'problem' is that a lot of the actual markup tags are extremely poorly documented, and things like 'LikeWord95' and such have no documentation at all, making it essentially impossible for anyone but Microsoft to create a 100% compatible loader/converter.

The XML makes it very easy to extract the actual human readable text strings, but decypering the layout still requires voodoo.

making it essentially impossible for anyone but Microsoft to create a 100% compatible loader/converter.

I wrote a module to create excel files, so it isn't that difficult.

Just requires a lot of reading of the documentation - as you'd expect.
(Went through the same process once to create PDFs - with Adobe's PDF spec)

@ nate It wouldnt be a crime, just a pain in the butt.

Use ODF or XML is a better idea though than trying to hack about an office DOC binary.
...Or even plaintext ascii if no formatting is needed :/

I wrote a module to create excel files, so it isn't that difficult.


Writing the latest & greatest version isn't that bad, it's *reading* the documents that originated in the old versions and where later saved in the newer format. They retain a lot of old formatting cruft under the hood, and there is next to no documentation on how to properly render those.

(Not much an an issue with Excel since there's not a lot of layout involved there, but horrendous when dealing with Word)