Click to Rate and Give Feedback
MSDN
MSDN Library
Office Development
Office 2003
Reference
Methods
C
 Compare Method
Collapse All/Expand All Collapse All
Word 2003 VBA Language Reference
Compare Method

Displays revision marks that indicate where the specified document differs from another document.

expression.Compare(Name, AuthorName, CompareTarget, DetectFormatChanges, IgnoreAllComparisonWarnings, AddToRecentFiles, RemovePersonalInformation, RemoveDateAndTime)

expression Required. An expression that returns a Document object.

Name   Required String. The name of the document with which the specified document is compared.

AuthorName   Optional Variant. The reviewer name associated with the differences generated by the comparison. If unspecified, the value defaults to the author name of the revised document or the string "Comparison" if no author information is present.

DetectFormatChanges   Optional Boolean. True (default) for the comparison to include detection of format changes.

IgnoreAllComparisonWarnings   Optional Variant. True compares the documents without notifying a user of problems. The default value is False.

AddToRecentFiles   Optional Variant. True adds the document to the list of recently used files on the File menu.

RemovePersonalInformation   Optional Boolean. True removes all user information from comments, revisions, and the properties dialog box in the returned Document object . The default value is False.

RemoveDateAndTime   Optional Boolean. True removes date and time stamp information from tracked changes in the returned Document object. The default value is False.

Example

This example compares the active document with the document named "FirstRev.doc" in the Draft folder and places the comparison differences in a new document.

Sub CompareDocument()
    ActiveDocument.Compare Name:="C:\Draft\FirstRev.doc", _
        CompareTarget:=wdCompareTargetNew
End Sub
		


Applies to | Document Object



© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker