We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Add one extra paragraph after mail merge with regions finished

I have mail merge with regions for multiple records from datasource, how can I add one paragraph at the very end of the output? Thank you.

Hi Lan,

Thanks for your inquiry.

In my opinion, you could simply insert a Bookmark at a place where you would like to insert a paragraph in Word document. Then by using MoveToBookmark method of DocumentBuilder class move the cursor to that location and finally insert some paragraph (rich content) there. Please see the following code snippet for clarification:

Document doc = new Document(@"c:\test\BookMark.docx");
DocumentBuilder builder = new DocumentBuilder(doc);

builder.Write("Your paragrapgh goes here");

Bookmark bookmark = doc.Range.Bookmarks["myBookMark"];
// You could optionally delete this bookmark. The bookmarked text is not deleted.


I hope, this will help.

Best Regards,

Thank you, Awais.