Solved

Word Mail merge shifting fields if blank

Posted on 2010-11-08
7
623 Views
Last Modified: 2012-05-10
Aloha I am using mail merge for the first time pretty successfully at thi spoint but I know there is alot more that can be done. Is there a way if a value is returned in a column that you can shift the bottom rows up. for example.

I dont want this
Ted Turner
123 main st.

Atlanta GA, 01921

I want this
Ted Turner
123 main st.
Atlanta GA, 01921

0
Comment
Question by:Wonderwall
  • 3
  • 2
  • 2
7 Comments
 
LVL 10

Expert Comment

by:honestman31
Comment Utility
in the mail merge Recipients  sort by names then just uncheck the empty names
0
 
LVL 10

Expert Comment

by:honestman31
Comment Utility
see this attachment
ZA001110953.gif
0
 

Author Comment

by:Wonderwall
Comment Utility
Ok, based on the example you have above I would have a Street address 2 which would have apt # lets say. In most cases this would be blank if it is then I need the city, state and zip to move up. I am wondering how do I chcek for a specific value and if it is blank or is equal to a value I don't want to print can I shift the rows printed up?

 
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 50

Expert Comment

by:teylyn
Comment Utility
Hello,

you can edit the field codes in Word to skip empty fields.

Hit Alt-F9 to see all Field codes. It will look something like

{ MERGEFIELD  "name" }
{ MERGEFIELD   "address1" }
{ MERGEFIELD   "address2" }
{ MERGEFIELD  "city" }

If you want to change the settings to skip the "address2" field if it is empty, follow these steps:

Highlight the line with "address2", then hit Ctrl-F9. This will encase the merge field into a new field, putting brackets before and after it. Then edit this to look like:

{ MERGEFIELD  "name" }
{ MERGEFIELD   "address1" }
{ IF { MERGEFIELD   "address2" } <> "" "{MERGEFIELD "address2" }
" ""}{ MERGEFIELD  "city" }

You can simply type the IF next to the new bracket, then add the <> signs. To insert the second Mergefield, hit Ctrl-F9 again after the <> "" "
Then manually type MERGEFIELD "address2" into the new set of brackets. Note that the paragraph mark sits inside a pair of double quotes.

The syntax for the IF statement in Word Field codes is { IF <condition> "this is printed on true" "this happens on false" }

Note that the false action is just an empty string and no paragraph mark after that. Then the "city" field will follow directly after the address1.

cheers, teylyn
0
 

Author Comment

by:Wonderwall
Comment Utility
Ok great one more thing if I wanted to not print a column value if it hit a specific value, let's say in the case "Apt 2" then I am assuming I can use this? Mahalo

 MERGEFIELD  "name" }
{ MERGEFIELD   "address1" }
{ IF { MERGEFIELD   "address2" } <> "Apt 2" "{MERGEFIELD "address2" }
" ""}{ MERGEFIELD  "city" }

0
 
LVL 50

Accepted Solution

by:
teylyn earned 500 total points
Comment Utility
Right. If the mergefield is not = Apt 2, it will be printed, followed by a paragraph mark. Otherwise, nothing will be printed and the city field follows next.
0
 

Author Closing Comment

by:Wonderwall
Comment Utility
thx dude
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Outline Suppose you have some simple text based data in Excel that you would like to display as a PowerPoint presentation. Of course it would be possible to write some fairly complex VBA code that created a new slide for each line of the Excel data…
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now