InsertField into Paragraph

Hi,

We use aspose with word merge feature.
We have an issue with InsertField method.

docBuilder.InsertField(@" MERGEFIELD  " + currentRegion + field.FieldName.ToUpper() + @"  \* MERGEFORMAT ", "«" + currentRegion + field.FieldName.ToUpper() + "»");

Imagine that my paragraph contrains this tag : “Dear @DATA_1,”
When I use InsertField on this paragraph then it replace the tag but also the comma !

I don’t want to add a space between the tag and the comma, how can I fix this ?

@DomZ Do you replace placeholder with MERGEFIELD? Unfortunately your requirements are not clear enough. If possible, please attach your input, output and expected output documents. This will help us to better understand your needs.

Sorry I have understood my mistake, problem solved.

1 Like