View Single Post
 
Old 11-06-2014, 06:13 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by meenagrace View Post
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
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote