Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-23-2014, 02:02 PM
redzan redzan is offline Extra lines in directroy when field is blank Windows 7 32bit Extra lines in directroy when field is blank Office 2003
Advanced Beginner
Extra lines in directroy when field is blank
 
Join Date: Feb 2012
Posts: 37
redzan is on a distinguished road
Default Extra lines in directroy when field is blank

I am using the follwoing with mail merge directory.

«Patient_Name»
CHART # «Patient_»
DOB: «DOB»
cc: «Primary_Care_Physician»
WCB (7) Insurance: «Ins_Plan»
«Employer»
«Injury_Date»


«No_Fault»

If cc, WCB, Employer, Injury Date, No Fault are empty in excel (not all have this but some do), I get a lot of extra blank lines before the next entry. How can I fix this?

Thank you
Reply With Quote
  #2  
Old 05-23-2014, 03:02 PM
macropod's Avatar
macropod macropod is offline Extra lines in directroy when field is blank Windows 7 32bit Extra lines in directroy when field is blank Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

You can suppress the empty lines using the mergefield \b or \f switches. First turn on Word's formatting display so you can see the ↵ & ¶ symbols that represent line & paragraph breaks. To conditionally suppress, the «Employer» field for example:
• select the field and press Shift-F9 to expose the field code. You should see
{MERGERFIELD Employer}¶
• Edit the field code so you get
{MERGERFIELD Employer \f "¶
"}
Note that the paragraph break is now inside the field and the «Injury_Date» field is now immediately after the "}
Similarly, to suppress the 'WCB (7) Insurance: «Ins_Plan»' line:
• select the field and press Shift-F9 to expose the field code. You should see
«Ins_Plan»
• Edit the field code so you get
{MERGERFIELD Ins_Plan \b "WCB (7) Insurance: " \f "¶
"}
Note that the 'WCB (7) Insurance: ' text and the paragraph break are now both inside the field.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-23-2014, 05:11 PM
redzan redzan is offline Extra lines in directroy when field is blank Windows 7 32bit Extra lines in directroy when field is blank Office 2003
Advanced Beginner
Extra lines in directroy when field is blank
 
Join Date: Feb 2012
Posts: 37
redzan is on a distinguished road
Default

Thank you. I tried to do what you said but can't seem to get it working. I will attach my file here. I already has some formatting inside the brackets and maybe that is why I'm struggling.
Attached Files
File Type: doc extra lines in directory.doc (25.5 KB, 12 views)
Reply With Quote
  #4  
Old 05-23-2014, 05:46 PM
macropod's Avatar
macropod macropod is offline Extra lines in directroy when field is blank Windows 7 32bit Extra lines in directroy when field is blank Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

I see you have implemented the \b switches, but you haven't implemented the \f switches...

As for the prefix text, if you don't want the \* Caps switch to apply to that, you'd need to use a nested field construction like:
{IF{ MERGEFIELD "Employer" } <> "" "Employer name: { MERGEFIELD "Employer" \* Caps}¶
"}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 05-23-2014, 06:28 PM
redzan redzan is offline Extra lines in directroy when field is blank Windows 7 32bit Extra lines in directroy when field is blank Office 2003
Advanced Beginner
Extra lines in directroy when field is blank
 
Join Date: Feb 2012
Posts: 37
redzan is on a distinguished road
Default

Thank you for your help. I think this is above my ability at the present time.
Reply With Quote
  #6  
Old 05-23-2014, 06:40 PM
macropod's Avatar
macropod macropod is offline Extra lines in directroy when field is blank Windows 7 32bit Extra lines in directroy when field is blank Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

It's really not that difficult. See attached.
Attached Files
File Type: doc Redzan.doc (26.5 KB, 15 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofit adding extra lines John_G Excel 0 11-20-2012 08:19 AM
Extra lines in directroy when field is blank Extra spaces between the lines after pasting data to Word ramsgarla Word VBA 1 10-29-2012 12:26 AM
Extra lines in directroy when field is blank Getting blank lines instead of supressed lines. Welshie82 Mail Merge 2 11-14-2011 01:41 AM
Extra lines in directroy when field is blank Slight extra space between lines. lucadelcarlo Word 1 04-23-2011 04:05 PM
Extra lines in directroy when field is blank How to turn all blank lines into non-blank for legal forms sieler Word 3 04-12-2009 01:38 PM

Other Forums: Access Forums

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


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