Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-09-2014, 12:54 PM
Licos101 Licos101 is offline Mail Merge Empty Data Field Windows 7 64bit Mail Merge Empty Data Field Office 2007
Novice
Mail Merge Empty Data Field
 
Join Date: Apr 2014
Posts: 2
Licos101 is on a distinguished road
Default Mail Merge Empty Data Field

So i have a small issue. I am doing a mail merge for a letter with a number of different records all at once. The layout is as follows:



Dear <firstname> <lastname>
<company name>
<Address>

Not all the records contain a company name. What I would like to do is when the company cell is empty in the excel merge spreadsheet for word to remove that line all together rather than giving me an error or leaving it blank.

Can someone let me know if this is possible and how i can go about it.
Reply With Quote
  #2  
Old 04-09-2014, 04:04 PM
macropod's Avatar
macropod macropod is offline Mail Merge Empty Data Field Windows 7 32bit Mail Merge Empty Data Field Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,348
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

1. Select your «CompanyName» field and press Shift-F9. You should see something like:
{ MEREGFIELD CompanyName }.
2. Edit the field code so you get:
{ MEREGFIELD CompanyName \ f ""}
3. Drag the paragraph/line break following the field into it, between the "", so you get:
{ MEREGFIELD CompanyName \ f "¶
"}
4. Press F9 to update the field code. You should now see:
«FirstName» «LastName»¶
«CompanyName»«Address»¶
5. Run the mailmerge.
The \f switch tells Word to insert the specified character if the field isn't empty. So, if the field is empty, you don't get the paragraph/line break.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 04-10-2014, 06:19 AM
Licos101 Licos101 is offline Mail Merge Empty Data Field Windows 7 64bit Mail Merge Empty Data Field Office 2007
Novice
Mail Merge Empty Data Field
 
Join Date: Apr 2014
Posts: 2
Licos101 is on a distinguished road
Default

Thanks Macropod! This totally worked
Reply With Quote
Reply

Tags
mail merge date format, mail merge help, mail merge; if; fill-in

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge Empty Data Field How to ignore a mail merge field if the field is blank redzan Mail Merge 1 05-16-2013 08:34 AM
Merge field source data field kckay Mail Merge 4 03-25-2013 11:06 AM
Mail Merge Empty Data Field How big can a mail merge field be? Engineer Mail Merge 2 12-11-2012 01:20 AM
Mail Merge Empty Data Field Mail Merge - If a field is black, take the data from the row below? mikeprent Mail Merge 5 01-05-2012 04:52 AM
Mail merge Field Code Manipulation macjnr Mail Merge 0 09-10-2009 11:37 AM

Other Forums: Access Forums - Senior Forums

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


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