Tuesday, March 15, 2011

How can you set default values for merge fields in a Microsoft Word document

I am using Aspose (.NET/C#) to generate a word document which contains multiple mail-merge fields. However as I have one methode handling a couple of different templates, not every merge field may get handled/merged.

Is there a way to set a default "text" value for merge fields?

From stackoverflow
  • I'm not 100% sure what you want to do but I suppose it could be done using conditional fields. Maybe something along the lines of this might work:

    { IF << Field1 >>="" "<< Field1 >>" "my default value" }

0 comments:

Post a Comment