How to compare Two Word Documents!

A

Ahmad Jalil Qarshi

hi!
i want to compare two different Word documents using VBA. is it possible? If
yes then plz help me how to do that.

Thanks in advance.

Ahmad jalil Qarshi
 
C

Chuck

Use .Compare:

ActiveDocument.Compare Name:="C:\temp\YourDoc.doc"

If you want to compare 2 documents that aren't open:

Dim doc1 As Document

Set doc1 = Documents.Open("C:\temp\doc1.doc")

doc1.Compare Name:="C:\temp\YourDoc.doc"
 
A

Ahmad Jalil Qarshi

Thanks Chuck!
It worked fine in case of text. but when i insert a picture on doc1 and
another different picture on doc2 and when i compare doc1 and doc2. it
doesn't display differences. furthermore if i change the size of one picture
to very small. it also doesn't display changes.
Isn't it possible to come over the two problems that are mentioned above.
Thanks
Ahmad Jalil Qarshi
 
W

Word Heretic

G'day "Ahmad Jalil Qarshi" <[email protected]>,

Word's built-in compare is quite limited. You may wish to investigate
a 3rd party product.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Ahmad Jalil Qarshi reckoned:
 
C

Cindy M -WordMVP-

Hi Ahmad,
It worked fine in case of text. but when i insert a picture on doc1 and
another different picture on doc2 and when i compare doc1 and doc2. it
doesn't display differences. furthermore if i change the size of one picture
to very small. it also doesn't display changes.
Isn't it possible to come over the two problems that are mentioned above.
If you need that fine a degree of checking, and want to do it with automation,
then the only thing I can suggest would be to export the Word binary files to
XML (2003, only) or RTF. Then compare them character by character.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top