Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-08-2011, 08:03 AM
Welshie82 Welshie82 is offline Getting blank lines instead of supressed lines. Windows 7 32bit Getting blank lines instead of supressed lines. Office 2007
Advanced Beginner
Getting blank lines instead of supressed lines.
 
Join Date: Oct 2011
Location: Birmingham
Posts: 33
Welshie82 is on a distinguished road
Default Getting blank lines instead of supressed lines.

My user is working on a mail merge document but isn't using the address block feature, instead has inserted field codes seperately. They are:

«Prefix» «Firstname» «Lastname»
«Organisation»
«Address1»
«Address2»
«Address3»
«Address4»
«City»
«County»
«Postalcode»
«Country»

We have 5 fields that are occasionally blank in the data form, but instead of supressing the lines it's leaving a blank space instead.

I know there is a merge code you can write using the "if" rule, but I'm really bad at coding the merge codes and field codes.



What code would I need to insert for word to suppress the lines of the following 5 field codes?

Address 3, Address 4, Organization, County and Country.
Reply With Quote
  #2  
Old 11-13-2011, 04:52 AM
macropod's Avatar
macropod macropod is online now Getting blank lines instead of supressed lines. Windows 7 64bit Getting blank lines instead of supressed lines. Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Welshie82,

There are two mergefield switches you can use for this:
\b - Specifies the text to be inserted before the MERGEFIELD field if the field is not blank.
\f - Specifies the text to be inserted following the MERGEFIELD field if the field is not blank.

For example, suppose your mergefield is «Data». Selecting the field and pressing Shift F9 will reveal:
{MERGEFIELD Data}
If you code the mergefield as:
{MERGEFIELD Data \b "¶
"}
(where ¶ is a pargraph break) it will insert a paragraph break before the mergefield if the field is not blank. Conversely, if you code the mergefield as:
{MERGEFIELD Data \f "¶
"}
it will insert the paragraph break after the mergefield if the field is not blank.

So, instead of having:
«Prefix» «Firstname» «Lastname»
«Organisation»
«Address1»
«Address2»
«Address3»
«Address4»
«City»
«County»
«Postalcode»
«Country»
you might add the \b switch to the «Organisation», «Address2», «Address3», «Address4», «County» & «Country» fields and lay them out as:
«Prefix» «Firstname» «Lastname»«Organisation»
«Address1»«Address2»«Address3»«Address4»
«City»«County»
«Postalcode»«Country»
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-14-2011, 01:41 AM
Welshie82 Welshie82 is offline Getting blank lines instead of supressed lines. Windows 7 32bit Getting blank lines instead of supressed lines. Office 2007
Advanced Beginner
Getting blank lines instead of supressed lines.
 
Join Date: Oct 2011
Location: Birmingham
Posts: 33
Welshie82 is on a distinguished road
Default

Wonderful, thank you Macropod.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting blank lines instead of supressed lines. Line Numbering & Blank Lines Ephasa Word 9 04-30-2020 02:09 PM
Getting blank lines instead of supressed lines. Blank lines in standard letters AlteDäne Mail Merge 5 06-29-2011 05:32 PM
Urgent help needed with removing blank lines... iammom2four Outlook 0 12-15-2010 06:12 AM
Getting blank lines instead of supressed lines. How to turn all blank lines into non-blank for legal forms sieler Word 3 04-12-2009 01:38 PM
Unable to print blank lines on a legal form dpenbag Word 0 03-20-2006 09:13 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:29 AM.


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