document.Merge() gives inconsistent results

A

Andy Fish

(this is a copy of a post I sent to a couple other groups but haven't had a
reply)

hello,

in office 2003, if you did

document1.Merge(document2)

it would report a line that is in document1 but not in document2 as
inserted, and a line that is in document2 but not in document1 as deleted.
i.e. it would assume that document1 is the "new" document and document2 is
the "old" document.

in office 2007 it is almost always the other way round i.e. assumes
document1 is the old and document2 is the new (AFAICR this is the same as
previous versions of office before 2003 used to do)

no problem so far, I just detect in my application (c# .net 2.0 FWIW) which
version of word I am connected to, and set the sense of the comparison
accordingly

HOWEVER, under office 2007, for some pairs of documents, I get the same
result regardless of whether I call:

document1.Merge(document2) or
document2.Merge(document1)

I.E. word 2007 is "intelligently" deciding which is the "new" and which is
the "old". from my experiments it does not seem that this has to do with the
file time stamp or the 'last saved' property.

Does anyone know how word 2007 decides which is the newer document and if
there is any way I can override it to force the sense of the comparison.

TIA

Andy
 
R

Russ

If they are .docx files then they are mostly xml code or metadata in the
file itself. If you opened a .docx file in NotePad, you might see the
relevant date keys.
What if you force a new edit (enter and delete a space character) and then
save what Word2007 thought was the older file? Does that make it the newer
file in Word2007's point of view?
 
A

Andy Fish

these aren't docx files but I take the point - I could examine them in XML
and try to work out what has changed.

if you edit both files and add a space then delete it, it reverts to the
"normal" behaviour i.e. whichever document you call merge on is assumed to
be the old document

it's very odd
 

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