DocumentAppendDocument Method (Document, ImportFormatMode, ImportFormatOptions)
Appends the specified document to the end of this document.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.9
Syntax
public void AppendDocument(
	Document srcDoc,
	ImportFormatMode importFormatMode,
	ImportFormatOptions importFormatOptions
)

Parameters

srcDoc
Type: Aspose.WordsDocument
The document to append.
importFormatMode
Type: Aspose.WordsImportFormatMode
Specifies how to merge style formatting that clashes.
importFormatOptions
Type: Aspose.WordsImportFormatOptions
Allows to specify options that affect formatting of a result document.
Examples
Shows how to resolve styles behavior while append document.
[C#]

Document srcDoc = new Document(MyDir + "DocumentBuilder.ResolveStyleBehaviorWhileAppendDocument.Source.docx");
Document dstDoc = new Document(MyDir + "DocumentBuilder.ResolveStyleBehaviorWhileAppendDocument.Destination.docx");

ImportFormatOptions options = new ImportFormatOptions();
// Specify that if numbering clashes in source and destination documents
// then a numbering from the source document will be used.
options.KeepSourceNumbering = true;
dstDoc.AppendDocument(srcDoc, ImportFormatMode.UseDestinationStyles, options);
dstDoc.UpdateListLabels();
See Also