Subdocuments.Merge Method (Word)

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


expression. Merge( _FirstSubdocument_ , _LastSubdocument_ )

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


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.


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), _ 
End If

See also

Subdocuments Collection Object