Free Support Forum - aspose.com

Word merge fields question


Hi,

I have this question regarding your excellent product:

I’m trying to complete with data the merge fields from a word document, but I dont want them to disappear afterwards, so the same document can be “refreshed” with new data after it is modified by the user.

Any idea how can this be done?

Thanks,

Adrian.


Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. MergeFields are removed from the document after mail merge. So you can’t use these fields after mail merge. As s workaround you can put values into the bookmarks. For example see the following code.

Bookmark myBookmark = doc.Range.Bookmarks["myBookmark"];

myBookmark.Text = "my value";

Best regards.