_Application.MergeDocuments Method

Definition

Compares two documents and returns a _Document object that represents the document that contains the differences between the two documents, marked using tracked changes.

public Microsoft.Office.Interop.Word.Document MergeDocuments (Microsoft.Office.Interop.Word.Document OriginalDocument, Microsoft.Office.Interop.Word.Document RevisedDocument, Microsoft.Office.Interop.Word.WdCompareDestination Destination = Microsoft.Office.Interop.Word.WdCompareDestination.wdCompareDestinationNew, Microsoft.Office.Interop.Word.WdGranularity Granularity = Microsoft.Office.Interop.Word.WdGranularity.wdGranularityWordLevel, bool CompareFormatting = false, bool CompareCaseChanges = false, bool CompareWhitespace = false, bool CompareTables = false, bool CompareHeaders = false, bool CompareFootnotes = false, bool CompareTextboxes = false, bool CompareFields = false, bool CompareComments = false, bool CompareMoves = false, string OriginalAuthor = "", string RevisedAuthor = "", Microsoft.Office.Interop.Word.WdMergeFormatFrom FormatFrom = Microsoft.Office.Interop.Word.WdMergeFormatFrom.wdMergeFormatFromPrompt);
abstract member MergeDocuments : Microsoft.Office.Interop.Word.Document * Microsoft.Office.Interop.Word.Document * Microsoft.Office.Interop.Word.WdCompareDestination * Microsoft.Office.Interop.Word.WdGranularity * bool * bool * bool * bool * bool * bool * bool * bool * bool * bool * string * string * Microsoft.Office.Interop.Word.WdMergeFormatFrom -> Microsoft.Office.Interop.Word.Document
Public Function MergeDocuments (OriginalDocument As Document, RevisedDocument As Document, Optional Destination As WdCompareDestination = Microsoft.Office.Interop.Word.WdCompareDestination.wdCompareDestinationNew, Optional Granularity As WdGranularity = Microsoft.Office.Interop.Word.WdGranularity.wdGranularityWordLevel, Optional CompareFormatting As Boolean = false, Optional CompareCaseChanges As Boolean = false, Optional CompareWhitespace As Boolean = false, Optional CompareTables As Boolean = false, Optional CompareHeaders As Boolean = false, Optional CompareFootnotes As Boolean = false, Optional CompareTextboxes As Boolean = false, Optional CompareFields As Boolean = false, Optional CompareComments As Boolean = false, Optional CompareMoves As Boolean = false, Optional OriginalAuthor As String = "", Optional RevisedAuthor As String = "", Optional FormatFrom As WdMergeFormatFrom = Microsoft.Office.Interop.Word.WdMergeFormatFrom.wdMergeFormatFromPrompt) As Document

Parameters

OriginalDocument
Document

Specifies the path and file name of the original document.

RevisedDocument
Document

Specifies the path and file name of the revised document to which to compare the original document.

Destination
WdCompareDestination

Specifies whether to create a new file or whether to mark the differences between the two documents in the original document or in the revised document. Default value is wdCompareDestinationNew.

Granularity
WdGranularity

Specifies whether changes are tracked by character or by word. Default value is wdGranularityWordLevel.

CompareFormatting
Boolean

Specifies whether to mark differences in formatting between the two documents. Default value is True.

CompareCaseChanges
Boolean

Specifies whether to mark differences in case between the two documents. Default value is True.

CompareWhitespace
Boolean

Specifies whether to mark differences in white space, such as paragraphs or spaces, between the two documents. Default value is True.

CompareTables
Boolean

Specifies whether to compare the differences in data contained in tables between the two documents. Default value is True.

CompareHeaders
Boolean

Specifies whether to compare differences in headers and footers between the two documents. Default value is True.

CompareFootnotes
Boolean

Specifies whether to compare differences in footnotes and endnotes between the two documents. Default value is True.

CompareTextboxes
Boolean

Specifies whether to compare differences in the data contained within text boxes between the two documents. Default value is True.

CompareFields
Boolean

Specifies whether to compare differences in fields between the two documents. Default value is True.

CompareComments
Boolean

Specifies whether to compare differences in comments between the two documents. Default value is True.

CompareMoves
Boolean

Specifies the name of the author of the original document.

OriginalAuthor
String

Specifies the name of the person to use for unattributed changes after merging two documents.

RevisedAuthor
String

Specifies the document from which to retain formatting.

FormatFrom
WdMergeFormatFrom

Specifies the document from which to retain formatting.

Returns

_Document

Applies to