Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2007

Tip: Looking for answers? Try searching our database.

document.Merge() gives inconsistent results

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy Fish - 21 Nov 2007 07:52 GMT
(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
Russ - 21 Nov 2007 08:06 GMT
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?

> (this is a copy of a post I sent to a couple other groups but haven't had a
> reply)
[quoted text clipped - 34 lines]
>
> Andy

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Andy Fish - 21 Nov 2007 12:59 GMT
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

> 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
[quoted text clipped - 47 lines]
>>
>> Andy

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.