FindAndInsertBookmark code


Where do i get this FindAndInsertBookmark method

Split document into multiple documents on special character


Please check the following requested code. We suggest you please read the following article. Hope this helps you.

Find and Replace

public class FindAndInsertBookmark : IReplacingCallback

    int i;
    ReplaceAction IReplacingCallback.Replacing(ReplacingArgs e)
        Paragraph para = (Paragraph)e.MatchNode.ParentNode;
        DocumentBuilder builder = new DocumentBuilder((Document)e.MatchNode.Document);
        builder.StartBookmark("BM_" + i);
        builder.EndBookmark("BM_" + i);

        return ReplaceAction.Skip;