Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare two Word documents

Status
Not open for further replies.

SurajJaldu

Programmer
Sep 7, 2007
3
CA
Hi,

I have to compare the text of two word documents. These word documents will be containing few images and table also. But, I just have to compare the text.

Can anybody please let me know how to do it?

Thanks,
Suraj
 
You should always mention what version you are using.

1. Open the first document.
2. Tools > Compare and Merge documents
3. Select the document to compare and merge

The changes/differences are marked as tracked changes.

Oh...and you should probably try looking in Help. It is a good place to start.

If this is not what you want - a merged document showing the differences - then you should clearly state what you do want. But the merged document does indeed compare.



faq219-2884

Gerry
My paintings and sculpture
 
Sorry.. I forgot mention the following things

- I need to achieve this using VBA code
- I am using MS word 2003.
 



Hi,

"I need to achieve this using VBA code."

Why is this a requirement? The best tool for the situation.

It might be like someone saying, "I want to drive in a screw, but I need to achieve this using a knife."

There's a better way as Gerry suggested. Turn on your macro recorder and record using Tools > Compare and Merge documents.

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
Hi Skip and Gerry,

Thanks for your replys.

Actually, I am working on an automation tool(TestPartner) that uses VBA language. So we have a requirement that will compare 2 word docs, we have to automate that process using that tool.

as this is the forum for VBA not word I hope people will understand my concern.

Thanks,
Suraj
 
Then do it as Skip suggests. Record a macro. Then adjust the code. You do not clearly state anything, for example, you do not state if you want code to run and compare the current (active) document with another; or compare two other documents. A rather crucial point.

In any case, you could adjust the macro code to take a document name (or the current document), and then take another document name and compare. Or take user input for the names.

Try recording a macro. When you have actual real questions regarding how to adjust the code, then post a question.

I just did it to compare two documents that are NOT the current active document. It is not that hard.

faq219-2884

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top