示例#1
0
        public static void InsertDocumentAtBookmark(this Document doc, string bookmarkName, Document srcDoc)
        {
            //ExStart:InsertDocumentAtBookmark
            Bookmark bookmark = doc.Range.Bookmarks[bookmarkName];

            DocumentUtility.InsertDocument(bookmark.BookmarkStart.ParentNode, srcDoc);
        }
        ReplaceAction IReplacingCallback.Replacing(ReplacingArgs e)
        {
            // Insert a document after the paragraph, containing the match text.
            Paragraph para = (Paragraph)e.MatchNode.ParentNode;

            DocumentUtility.InsertDocument(para, _subDoc);

            // Remove the paragraph with the match text.
            para.Remove();

            return(ReplaceAction.Skip);
        }