I understand that IF statements are not supported in MergeFields at the moment and are ignored during the Merge process.
I also understand that you can use the Document Mailmerge MergeHandler event for postprocessing of formatting on Merge Fields.
I need to change the value of a merge field based on a list of options at merge time. The same mergefield in different locations may be changed into any one of the options. These options that can only be held in the document field itself as they are per each instance of the mergefield. I want to do this by adding custom flags to the mergfield and handling them in the MergeHandler Event.
For example the field may be ClientType which chould be one of (Male, Female or JointParty). ClientType may be present in several palces in the document. In the first location I need it to display He if a Male, She if a Female or They if JointParty.
He requires a new Contract
She requires a new Contract
They require a new Contract
The bolded text shows where the mergefield has been inserted and translated
Elsewhere in the document it may say
These merges are based on the value of ClientType which can equal (Male, Female or JointParty)
I can catch the merge event for this field in the MergeHandler Event handler, I also know that if I have data tagged to the mergefield I can convert the values to the ones I want.
This is a feature that I must be able to implement inorder to use Aspose.Words in this project - is this possible or is there a better way to accomplish what I am trying to do?