A little background on what I am trying to achieve. I am trying to generate documents on server side based on Microsoft Mail Merge templates that has "MERGEFIELD". I think TX Text Control can handle this using TXDocumentServer Mail Merge object and TXTextControl.Server assamblies. What I am stuck on is, after I run Mail Merge, the MERGEFIELDS that has empty values stays as blank lines on a merged document. Is there anyway to remove those fields?
I think there is a way for me to parse out all the MergeFields on a given word template and examine whether those fields has trailing CRLF in them and if they do, remove those CRLF if the value to be merged into the MergeField is empty. However, I am not able to find any existing sample in the forum or on TXTextControl site. Can anyone point me in the right direction?
Thanks in advance.