Quote:
Originally Posted by meenagrace
When I try to compare documents using Microsoft.Office.Interop.WordApplication.CompareDo cuments in C# , warning dialog box is displayed. how to close/avoid that dialog box programmatically.
|
Without knowing what the warning dialog box is, it's impossible to say. The following runs to conclusion in VBA without any warning dialog boxes being displayed.
Code:
Sub Demo()
Dim DocOld As Document, DocRev As Document, DocCmp As Document
Set DocOld = Documents.Open("C:\Users\" & Environ("UserName") & "\Documents\Original.docx", AddToRecentFiles:=False, Visible:=False)
Set DocRev = Documents.Open("C:\Users\" & Environ("UserName") & "\Documents\Modified.docx", AddToRecentFiles:=False, Visible:=False)
Set DocCmp = Application.CompareDocuments(OriginalDocument:=DocOld, RevisedDocument:=DocRev, Destination:=wdCompareDestinationNew)
DocOld.Close False: DocRev.Close False
DocCmp.Activate
End Sub
For PC macro installation & usage instructions, see:
http://www.gmayor.com/installing_macro.htm
For Mac macro installation & usage instructions, see:
http://word.mvps.org/Mac/InstallMacro.html