MergeField with Caluculation- Rounding and Formating

Hi


I’ve got a little problem here - I guess it’s rather related to MS Word then specificly to ASPOSE. But I’ll give it a try anyway.

I should display a tax-amount in a merge-file but only have a merge-field containing the total amount. The merge-field containing the total value is called “Totalbetrag”. So my current approach was to insert a new field with the following formula:

={ROUND({MERGEFIELD Totalbetrag}*0.08, 2) # “#0,00’%’”}

Sadly, entering this results in Word displaying “Syntax Error”…
So, is something like this possible at all? If so, will it work in ASPOSE.Words? And if so, how would I do it correctly? It seems it doesn’t make a difference whether I’m using the mergefield-dialog or I hit ALT-F9 and write the code myself…

Any help is appreciated!


Regards,
Andy


EDIT:

Used the following Code in the Field:

{ = ROUND({ MERGEFIELD Totalbetrag }*0.08, 2) # “'CHF '#0,00” * MERGEFORMAT }

Still not valid. Word doesn’t show the Syntax Error, but after Mailmerge the field contains the following:

!Undefined Bookmark,
{MERGEFIELDTOTALBETRAG}

Hi Andreas,


Thanks for your inquiry. Please attach following resources here for testing:

  • Your input Word document
  • Aspose.Words generated output document showing the undesired behavior
  • Your expected Word document. We will investigate the structure of your expected document as to how you want your final output be generated like. You can create expected document using Microsoft Word.
  • Source code you’re currently using.

We will investigate the issue on our end and provide you more information.

Best regards,