Пример #1
0
        public static void InsertDocument()
        {
            WordFile     wordFile = new WordFile();
            WordDocument source   = wordFile.Import(File.ReadAllBytes("source.docx"));
            WordDocument target   = new WordDocument();

            WordDocumentBuilder builder = new WordDocumentBuilder(target);

            builder.CharacterState.FontSize = 30;

            builder.InsertLine("Text start in target document.");

            //Insert the source document just after the first paragraph in the target document
            builder.InsertDocument(source);

            //This line will be appended tight after the source document content
            builder.InsertLine("Text end in target document.");

            File.WriteAllBytes("InsertDocument.docx", wordFile.Export(target));
        }