There is nothing in your post that indicates what the custom data types might be or what formatting is required.
For the conditional line output, see
Mailmerge Empty Line Suppression in the
Mailmerge Tips & Tricks 'Sticky' thread at the top of this forum:
https://www.msofficeforums.com/mail-...ps-tricks.html
No VBA needed for this.