Reply
 
Thread Tools Display Modes
  #1   Report Post  
Julia
 
Posts: n/a
Default How do I skip blank fields in mail merge

I'm printing mail merged labels & some records have multiple address fields &
some only have 1 - how do a skip a blank field in a record. I can't seem to
locate something like "do not print blank fields" or "skip to next field if
blank".
  #2   Report Post  
WordBanter AI WordBanter AI is offline
Word Super Guru
 
Posts: 1,200
Thumbs up Answer: How do I skip blank fields in mail merge

Hey there! I'd be happy to help you with that.

To skip blank fields in a mail merge, you can use the IF field code in Microsoft Word. Here's how:
  1. Open your mail merge document in Microsoft Word.
  2. Click on the Insert tab in the ribbon.
  3. Click on Quick Parts, then select Field.
  4. In the Field dialog box, select IF from the list of field names.
  5. In the Field codes box, enter the field name for the field you want to check for blank values. For example, if you want to check if the Address2 field is blank, you would enter MERGEFIELD Address2.
  6. After the field name, enter the comparison operator and the value to compare against. For example, to check if the Address2 field is blank, you would enter = "" (an equal sign followed by two quotation marks).
  7. After the comparison value, enter the text to display if the condition is true (i.e. if the field is blank). For example, you could enter a space or a hyphen to indicate a blank field.
  8. After the true condition text, enter the text to display if the condition is false (i.e. if the field is not blank). For example, you could enter the field name again to display the actual value of the field.
  9. Click OK to close the Field dialog box.

Here's an example of what the IF field code might look like:

PHP Code:
{ IF { MERGEFIELD Address2 } = "" " - " MERGEFIELD Address2 } } 
This code checks if the Address2 field is blank. If it is, it displays a hyphen. If it's not, it displays the actual value of the field.

You can repeat this process for each field you want to check for blank values. Just make sure to update the field name and comparison value for each field.

I hope that helps!
__________________
I am not human. I am a Microsoft Word Wizard
  #3   Report Post  
Doug Robbins
 
Posts: n/a
Default

Use a " Skip Record If" field. When you insert such a field there is a
dialog box that opens and allows you to input the conditions.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"Julia" wrote in message
...
I'm printing mail merged labels & some records have multiple address
fields &
some only have 1 - how do a skip a blank field in a record. I can't seem
to
locate something like "do not print blank fields" or "skip to next field
if
blank".



  #4   Report Post  
Julia
 
Posts: n/a
Default

Doug - that didn't help - it skips the entire record rather than just the
blank field.

"Doug Robbins" wrote:

Use a " Skip Record If" field. When you insert such a field there is a
dialog box that opens and allows you to input the conditions.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"Julia" wrote in message
...
I'm printing mail merged labels & some records have multiple address
fields &
some only have 1 - how do a skip a blank field in a record. I can't seem
to
locate something like "do not print blank fields" or "skip to next field
if
blank".




  #5   Report Post  
David
 
Posts: n/a
Default

Try this...

Press Alt-F9 to show field code.
The insert code similar to this...

{ MERGEFIELD "CustomerAddress1" }{ IF { MERGEFIELD "CustomerAddress2" } "" "
{ MERGEFIELD "CustomerAddress2" }" "" }

The if statement checks to see if the second line of the address is blank or
not. If it is not blank then it does a carriage return then iserts the
second address line. If it is blank it does nothing.

Hope this helps

"Julia" wrote:

Doug - that didn't help - it skips the entire record rather than just the
blank field.

"Doug Robbins" wrote:

Use a " Skip Record If" field. When you insert such a field there is a
dialog box that opens and allows you to input the conditions.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"Julia" wrote in message
...
I'm printing mail merged labels & some records have multiple address
fields &
some only have 1 - how do a skip a blank field in a record. I can't seem
to
locate something like "do not print blank fields" or "skip to next field
if
blank".




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
In mail merge I don't want to print blank fields Richard Mailmerge 7 July 11th 05 03:45 PM
mail merge with attachments AS Mailmerge 5 April 9th 05 09:49 AM
Splitting text from mail merge fields Mark Ainsworth Mailmerge 1 March 29th 05 08:34 PM
How do I remove or supress blank data in fields in mail merge e.g. J&L Mailmerge 2 January 14th 05 07:04 AM
Empty Mail Merge Fields Meggan Microsoft Word Help 0 January 13th 05 01:43 AM


All times are GMT +1. The time now is 11:20 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"