View Single Post
  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Invoking compare and merge from the command line

You could have your application write a text file to a known location, with
that file containing the full paths to the two files. Then the macro can
read the text file to get the file paths to use in the merge.

You are correct that there is no way to pass parameters directly on the
command line to a macro that's invoked with the /m switch.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Wilhansen Li wrote:
I don't think there's really anyway so what I did was I opened both
files and invoked the compare operation like this:

Sub CompareAndMerge()
file1 = ActiveDocument.FullName
ActiveDocument.Close
file2 = ActiveDocument.FullName
ActiveDocument.Close
Documents.Open(file1).Merge (file2)
End Sub

So I just invoke it via command like like this:
WINWORD.exe mine.doc theirs.doc /mCompareAndMerge

Is this good enough? or are there better ways to do it?