Hello

I need to do a line by line compare between two Msword 07 documents. I've tried the conventional way of using getline and compare but it doesnt work. While step by step execution, the program is unable to recognise the format of the sentences in the word document. I only need to search for strings that start with specific letters, ex: "[Test_".

Any suggestions on how to go about this? Preferably through simple c++ commands as I am not an expert and dont have much time.

Please help
Thanks in advance
Sreekiran

The quick and dirty way is to save them both out to text files (with Save As...) and go the getline route. The 07 and later .docx is XML based, but it's still a binary file, I believe.

Edited 5 Years Ago by jonsca: n/a

The quick and dirty way is to save them both out to text files (with Save As...) and go the getline route. The 07 and later .docx is XML based, but it's still a binary file, I believe.

Hello Jonsca

Is it possible to automate the save as option, through c++? I've tried manually and the .txt file content is correct and reflects the content in the .doc file. Any resources you could provide? Sorry, newbie here! :)


Thank you!
Sreekiran

Edited 5 Years Ago by sreekiranws: correction

A DOC file isn't text, it's binary. The only way to do what you want is to understand the format of a .DOC file. Use GOOGLE.

Is it possible to automate the save as option, through c++?

Possible, possibly. You could write a macro in VBA that would dump the files into a directory which your C++ program could watch for changes. Weigh the effort you have to put in with your current knowledge against any time that you might save doing it this way.

This article has been dead for over six months. Start a new discussion instead.