'''' This code is part of Document Solutions for Word demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystem.IOImportsGrapeCity.Documents.Word '' This sample shows how to merge two DOCX files into one.PublicClassMergeDocsPublicFunctionCreateDocx() AsGcWordDocumentDim doc1 = NewGcWordDocument() doc1.Load(Path.Combine("Resources", "WordDocs", "SampleParagraphs.docx")) Dim doc2 = NewGcWordDocument() doc2.Load(Path.Combine("Resources", "WordDocs", "BuiltInStyles.docx")) '' Static MergeDocuments() method overloads allow to merge any number of documents.'' Internally, those methods call the Body.CopyTo() method on each of the documents'' being merged, so the same results can be achieved using CopyTo().'' The different overloads allow to merge documents with full formatting,'' without formatting, Or using combinations of both.'' Here we demonstrate the most flexible MergeDocuments() overload by merging the'' two loaded documents twice, first copying their original formatting, And then'' clearing itDim doc = GcWordDocument.MergeDocuments( (doc1, FormattingCopyStrategy.Copy), (doc2, FormattingCopyStrategy.Copy), (doc1, FormattingCopyStrategy.Clear), (doc2, FormattingCopyStrategy.Clear)) '' DoneReturn docEndFunctionEndClass