Hi there.
Firstly.. I’m new to openxml so please forgive me if my terminology isn’t correct.
I have a word document that I want to use for mail merge.
Some of the mail merge fields are within a a shape field Before Mail Merge (Template)
Now I run the code I found on the following site Fill Mergefields in .docx Documents without Microsoft Word
The code then basically converts the ComplexField types to SimpleField types. We do this for backward compatibilty for older documents.
Now … the code works great. Except when a field is within a shape. Then the result is as follows
After mail merge
So basically what happens in the c# code the ComplexField is replace with a SimpleField and this works great except when a field is within a shape. So after I run the mail merge, all the fields are correctly filled in, but the new document doesn’t contain the shape as well as the Field (e.g. BankSortCode in image of “Before Mail Merge” in this post.
Can you please tell me why this occurs and how to prevent it. I need the shape in the new document that is created after the mail merge occurs as well as the field to be filled in that is contained in it.