Formatting within conditional statement

We have some text within a Word document that is wrapped within a conditional statement

The conditional statement evaluates correctly to either display or hide the text. When the field codes are displayed, the text is entirely in bold. When the results are displayed, the text is in non bold for the first few characters.

Below is the HTML representation of the offending item (via Firebug). There are no hidden characters showing in Word

Please tick the appropriate box to select the AVC benefit you wish to receive:

What could be adding the superflous tag midway through the text? All the font/paragraph settings appear fine and consistent throughout the entire text string

As I recall, when you are inserting a field in Word, whatever font styles you use for the first character of the field (e.g., {MERGEFIELD myField}) will be applied to the entire field result. Notice the underlined “M.” This would cause the entire result to be underlined. You can also achieve some unexpected results if you do not use /* MERGEFIELD and/or /* CHARFORMAT switches correctly in your fields.


Your attachment is inaccessible, and so I am speculating as to things you might consider.

Hi Mike,


Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input template Word document.
  • Aspose.Words generated output document which shows the undesired behavior.
  • Please create a standalone (runnable) console application that helps us reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information.

Best regards,