Question

I am using VB.net 2010 to generate a letter from a Word 2002 template. The template has MailMerge bookmarks where the database values will be displayed (for example the letter receiving company's address). Currently I have:

«Company Contact»
«Company Name»
«Address1»
«Address2»
«City», «State», «ZipCode»

If "Address2" value is blank, then don't display the bookmark in the letter output (hence avoid displaying a blank line)

How can I go about doing this?

Was it helpful?

Solution

Use an <<AddressBlock>> instead of using the individual merge fields. Empty values will be suppressed. http://office.microsoft.com/en-us/word-help/field-codes-addressblock-field-HP003069839.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top