Subdocuments.Merge method (Word)

Merges the specified subdocuments of a master document into a single subdocument.

Syntax

expression.Merge (FirstSubdocument, LastSubdocument)

expression Required. A variable that represents a 'Subdocuments' collection.

Parameters

Name Required/Optional Data type Description
FirstSubdocument Optional Variant The path and file name of the original document you want to merge revisions with.
LastSubdocument Optional Variant The last subdocument in a range of subdocuments to be merged.

Example

This example merges the first and second subdocuments in the active document into one subdocument.

If ActiveDocument.Subdocuments.Count >= 2 Then 
 Set aDoc = ActiveDocument 
 aDoc.Subdocuments.Merge _ 
 FirstSubdocument:=aDoc.Subdocuments(1), _ 
 LastSubdocument:=aDoc.Subdocuments(2) 
End If

See also

Subdocuments Collection Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.