#1
|
|||
|
|||
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? |
#2
|
|||
|
|||
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 |
#3
|
||||
|
||||
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 [Fmr MS MVP - Word] |
#4
|
|||
|
|||
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. |
#5
|
||||
|
||||
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 [Fmr MS MVP - Word] |
#6
|
|||
|
|||
I only suggested this simple way be tried. If it doesn't work, then one can try more complicated remedies.
|
#7
|
||||
|
||||
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 [Fmr MS MVP - Word] |
#8
|
|||
|
|||
Now you've made me feel bad.
But, Merry Christmas anyway. |
#9
|
|||
|
|||
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? |
#10
|
||||
|
||||
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 [Fmr MS MVP - Word] |
#11
|
|||
|
|||
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. |
#12
|
||||
|
||||
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.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mail Merge in Word: creating a rule for blanks | cgranada | Mail Merge | 6 | 02-27-2017 09:08 AM |
Easy mail merge but want to suppress rows | ClaireAMAdams | Mail Merge | 5 | 04-30-2013 02:43 PM |
Conditional merge fields in mail merge | Aude | Mail Merge | 1 | 01-06-2012 07:38 PM |
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 |