Learning resources for Word Merge Field

Hi,

I am currently using word merge fields, but I am not exposed to how it’s happening in the code behind. However, I leaned that it’s your library that has been doing the work for it.
So my question is there documentation or tutorials for people who only deal with those placeholders?

Thank you

@Ebraheem Sure, you can learn about mail merge feature from our documentation.
The following article explains the different with simple mail merge and mail merge with regions.
Please feel free to ask in case of any issues, we will be glad to help you.

Hi Alex,

The documentation didn’t specify how to access index of some item through the word document. Or how to add an if statement in the middle of StartTable and EndTable. Please, I am looking for those type of operations within iterations. Thank you.

@Ebraheem Mail merge feature uses standard MS Word fields. Unfortunately there is no way to get the index of the record unless there is fields with record index value in your data source. However, you can easily get this value in the code. For example you can use IFieldMergingCallback.

In the template you can use MergeField, If, Next and NextIf field. So to insert conditional content in your template you can simply use IF field. For example:
{ IF "{ MERGEFIELD MyField }" = "True" "This value will be displayed if MyField value is 'True'" "This is False value" }

1 Like