Microsoft Office Forums Suppress blanks in mail merge

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-05-2013, 03:57 AM
0nyx175 0nyx175 is offline Suppress blanks in mail merge Windows 7 64bit Suppress blanks in mail merge Office 2010 64bit
Novice
Suppress blanks in mail merge
 
Join Date: Aug 2013
Posts: 3
0nyx175 is on a distinguished road
Default Suppress blanks in mail merge

Hi guys,

I've searched and searched and not been able to come up with an answer. If I have information as below:

Add_1: 19 Smith Road


Add_2: Holyroyd
Add_3:
Add_4: Chorlston
Add_5:
Add_6: MK12RR

Can you tell me how I merge it so it suppresses blanks and shows as follows:

19 Smith Road
Holyroyd
Chorlston
MK12RR

Thus removing any blanks and making everything look nice and neat. I've been messing around with If statements but can only seem to get one of those - for example If address 2 is blank then print address 3 but this doesn't shift everything else up.

Any suggestions?
Reply With Quote
  #2  
Old 09-25-2013, 06:50 AM
Jodge5595 Jodge5595 is offline Suppress blanks in mail merge Mac OS X Suppress blanks in mail merge Office 2008 for Mac
Novice
 
Join Date: Sep 2013
Location: leeds
Posts: 1
Jodge5595 is on a distinguished road
Default

Help - i am a complete novice and have the same problem. Want to delete blank line from those customers who have 3 line address not 4. No idea what \b /f means someone else has mentionned.
Can anyone explain this in layman's terms?
Thanks
Reply With Quote
  #3  
Old 09-29-2013, 08:19 PM
macropod's Avatar
macropod macropod is offline Suppress blanks in mail merge Windows 7 32bit Suppress blanks in mail merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,525
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

See: http://office.microsoft.com/en-us/wo...005186172.aspx

If using Windows, for such a case you might delete the paragraph break after Add_2 and add a \b switch to 'Add_3', thus:
{MERGEFIELD Add_3 \b ¶}
where the ¶ is an actual paragraph break. To add the switch, select the «Add_2» field and press Shift-F9 to expose its code. Press F9 again when you're done.

If using a Mac, for such a case you might delete the paragraph break after Add_2 and code an IF field thus:
{IF «Add_3» <> "" "¶«Add_3»}

Note: The field brace pairs (ie '{ }') for the above examples are created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from this message. Likewise, you can't type or copy & paste the chevrons (ie '« »') - they're part of the actual mergefields, which you can insert from the mailmerge toolbar. Instead of the ¶, you should use a real line/paragraph break.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #4  
Old 12-21-2013, 04:01 PM
Voyager Voyager is offline Suppress blanks in mail merge Windows 7 64bit Suppress blanks in mail merge Office 2010 64bit
Novice
 
Join Date: Dec 2013
Posts: 4
Voyager is on a distinguished road
Default

Try this:

1. Make sure that each of your six lines has only the mergefield in it - no other text, space, punctuation, or coding.
2. End each line with the Enter key (don't use the shift key with it).

If the result is not single line-spaced, adjust this in the Paragraph dialog box.
Reply With Quote
  #5  
Old 12-21-2013, 08:33 PM
macropod's Avatar
macropod macropod is offline Suppress blanks in mail merge Windows 7 32bit Suppress blanks in mail merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,525
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Hi Voyager,

Messing around with paragraph spacing and the like cannot be relied upon to produce the required results; hence the switch-based solution which can be relied upon.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #6  
Old 12-23-2013, 03:20 PM
Voyager Voyager is offline Suppress blanks in mail merge Windows 7 64bit Suppress blanks in mail merge Office 2010 64bit
Novice
 
Join Date: Dec 2013
Posts: 4
Voyager is on a distinguished road
Wink

I only suggested this simple way be tried. If it doesn't work, then one can try more complicated remedies.
Reply With Quote
  #7  
Old 12-23-2013, 05:18 PM
macropod's Avatar
macropod macropod is offline Suppress blanks in mail merge Windows 7 32bit Suppress blanks in mail merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,525
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

I fail to see how your solution is less complicated than adding a field switch. Amongst other things, it doesn't work unless each line is a separate paragraph, which compromises any Style-based document formatting such as space before/after, indents, etc, all of which increase the difficulty of maintaining the document and can lead to document instability.

You might also note that the thread to which you were replying was last updated nearly three months ago. I very much doubt either of the original posters is still looking for a solution. Since your posts here are little more than a repeat of what you've posted elsewhere (e.g. http://social.technet.microsoft.com/...pty?forum=word), I trust I'm not going to have to point out the deficiencies of your approach all over the web...
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #8  
Old 12-24-2013, 09:13 AM
Voyager Voyager is offline Suppress blanks in mail merge Windows 7 64bit Suppress blanks in mail merge Office 2010 64bit
Novice
 
Join Date: Dec 2013
Posts: 4
Voyager is on a distinguished road
Default

Now you've made me feel bad.

But, Merry Christmas anyway.
Reply With Quote
  #9  
Old 01-02-2014, 08:56 AM
tswilson21 tswilson21 is offline Suppress blanks in mail merge Windows 7 32bit Suppress blanks in mail merge Office 2013
Novice
 
Join Date: Jan 2014
Posts: 2
tswilson21 is on a distinguished road
Default Can't resolve issue with solution provided

Hi,

I am essentially trying to do the same thing, but with an address field. I have been lurking on several forums trying to solve this issue, but all solutions don't work. In the address area of my forum I want to skip address 2 if the client does not have address 2 in their client record. The result ends up looking like this.

<name>
<address 1>

<city, state, zip>

When I want it to print like this if there is no address 2...

<name>
<address 1>
<city, state, zip>

My code is as follow which I believe mirrors your example...

{MERGEFIELD NLADDRESS2 \b
}

I also tried the if statement...

{IF NLADDRESS2 <> "" "
NLADDRESS2}

What am I doing wrong?
Reply With Quote
  #10  
Old 01-02-2014, 08:53 PM
macropod's Avatar
macropod macropod is offline Suppress blanks in mail merge Windows 7 32bit Suppress blanks in mail merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,525
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Without seeing a document containing the actual mergefields, it's hard to say what the issue is. Are you actually Executing (Finishing) the merge, or just previewing it? Previews do not give a reliable indicator of the merged output.

You can attach a document to a post (delete anything sensitive) via the paperclip symbol on the 'Go Advanced' tab.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #11  
Old 01-03-2014, 06:58 AM
tswilson21 tswilson21 is offline Suppress blanks in mail merge Windows 7 32bit Suppress blanks in mail merge Office 2013
Novice
 
Join Date: Jan 2014
Posts: 2
tswilson21 is on a distinguished road
Default

Hi Macropod,

I am actually running the merge. This document is a template file that I load into an ERP/CRM system. I then run the mail merge through that system. The data is loading correctly after the mail merge, but will not skip the address 2 line if no address 2 is present in the system.

Thank you for your time.
Attached Files
File Type: doc Mail Merge Test 12_31.doc (26.5 KB, 22 views)
Reply With Quote
  #12  
Old 01-07-2014, 02:45 PM
macropod's Avatar
macropod macropod is offline Suppress blanks in mail merge Windows 7 32bit Suppress blanks in mail merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,525
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

I've tested your attachment with a data source of my own (using different field names) and established that Previews 1 & 4 work fine as they are. Previews 2 & 3 lacked the quote characters necessary to make them work and the field with the switch in Preview 2 needed to be one paragraph lower. With those issues addressed, all four previews work, though Previews 2 & 3 don't honour the inter-paragraph spacing (an apparent limitation of that method).

See attached.
Attached Files
File Type: doc Mail Merge Test.doc (28.0 KB, 51 views)
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Suppress blanks in mail merge Mail Merge in Word: creating a rule for blanks cgranada Mail Merge 6 02-27-2017 09:08 AM
Suppress blanks in mail merge Easy mail merge but want to suppress rows ClaireAMAdams Mail Merge 5 04-30-2013 02:43 PM
Suppress blanks in mail merge Conditional merge fields in mail merge Aude Mail Merge 1 01-06-2012 07:38 PM
Suppress blanks in mail merge fill blanks in box keevitaja Word 1 05-23-2011 06:34 PM
Suppress Dialog Box crutch024 Word 0 08-17-2010 09:52 AM


All times are GMT -7. The time now is 12:16 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft