Compare Method, what's new in Word 2003??

M

Mike Evraire

Hi,

I have been using the Document.Compare method in VB6 in the past and now that we've upgraded to Word 2003 here at my office, my application no longer displays the results of the compare method. In essence, I have two HTML documents, one which I will simply call "c:\Original.htm" and the other would be "c:\Revised.htm". When my form opens, I open the revised document and then I call the compare method, passing along my original document in parameter. Finally I save the resulting merged document as "c:\compared.htm" and then use my browser object to navigate to this new document. The new document contains the result from my merge but there is absolutly no formatting to indicate what was removed or added. I'm expecting to see some strike-throughs and some underlines and a bit of color but there's nothing.

Does anyone know what I need to add to my code to get this to work properly with Word 2003? Here's my VB6 code

Dim oWord As Word.Applicatio
Dim oDocument As Word.Documen

Set oWord = New Word.Applicatio
Set oDocument = oWord.Documents.Open("c:\Revised.htm"

Call oDocument.Compare("c:\Original.htm"
Call oDocument.SaveAs("c:\Compared.htm"

oDocument.Clos

'added this line because Word was asking if I wanted to save changes to Document1 before closin
oWord.Documents(1).Saved = Tru
oWord.Qui

Call htmlPreview.Navigate2("c:\Compared.htm"

Set oDocument = Nothin
Set oWord = Nothin
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?TWlrZSBFdnJhaXJl?=,
I have been using the Document.Compare method in VB6 in the past and now that we've
upgraded to Word 2003 here at my office, my application no longer displays the results of
the compare method. In essence, I have two HTML documents, one which I will simply call
"c:\Original.htm" and the other would be "c:\Revised.htm". When my form opens, I open the
revised document and then I call the compare method, passing along my original document in
parameter. Finally I save the resulting merged document as "c:\compared.htm" and then use
my browser object to navigate to this new document. The new document contains the result
from my merge but there is absolutly no formatting to indicate what was removed or added.
I'm expecting to see some strike-throughs and some underlines and a bit of color but
there's nothing.Which version of Word did you use this with, previously?

There were major changes in Word 2002 that have been refined in Word 2003. For one thing,
by default, changes are displayed in "balloons" in the right margin, and not in the text.

If you're trying to review the result in a browser, you may not be getting the
interfaces...

If you change your code to work with *.doc files, then open the compared result in Word,
do you see what I'm talking about? And if you then save this as *.htm, close and open that
in Word do you still see these things (just making sure they save in *.htm format)?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
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 :)
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?TWlrZSBFdnJhaXJl?=,
Thanks for taking the time in replying to my previous post. I believe your right, the
problem had to due with the fact that Word was using its balloons in the right margin and
that's probaby where the problem was. I did manage to solve the problem though. I don't
know why I didn't think of this earlier, but I simply opened Word, started a Macro, opened
the Options and set it to never use Ballons, then I opened my documents, called the Merge
function and after getting my result, I stopped the macro and went into the editor to check
out what kind of code it generated. It turns out this held the key to my solution. I
believe the following line in paticular might be what was most important:
oWord.ActiveWindow.View.RevisionsMode = wdInLineRevisions

So I finally got my code to work as it used to!
Good :) Glad you discovered the options you need. That was going to be the next thing I
suggested, but I first wanted to be sure there wasn't something else that might have made
that a wild goose chase.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
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