MailMerge
MailMerge copied to clipboard
Support for replacing MERGEFIELD with a table
Is it possible to replace a MERGEFIELD with a table? If not supported in the present version, how do you think I can achieve this?
No, not possible because the values for replacement are in a Dictionary<string, string>, so you can only replace mergefields with plain text.
The starting point for you to do it would be, I think, to spend enough hours (or days!) on e.g. MS Learn on OOXML for wordprocessing and/or The Spec and/or the much more readable officeopenxml.com — in fact that website is probably the least daunting place to start — and/or stepping though some examples in Learn.Some.OpenXml in your debugger to get a feel for to work with a word XML document.
One task would be to work out whether or not the mergefield part of the spec lets you insert tables — I suspect not! But that doesn't really matter — you could use search-and-replace functionality instead.