Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-18-2012, 09:32 AM
cgranada cgranada is offline Mail Merge in Word: creating a rule for blanks Windows 7 32bit Mail Merge in Word: creating a rule for blanks Office 2007
Novice
Mail Merge in Word: creating a rule for blanks
 
Join Date: Jun 2012
Posts: 2
cgranada is on a distinguished road
Default Mail Merge in Word: creating a rule for blanks

Hi,



I'm doing a mail merge on Word with a database from Excel (version 2007) and there is a set number of fields that I'm getting data in for the letters I'm creating.

The issue is that for some of the letters/people, some fields don't really apply... so can I create a rule for blank fields (whenever blank or "0") so it ommits those irrelevant fields for a given person?

Say we had a table with scores:

Math - 86

English - 64

Arts - blank/0 (because it's not applicable to this specific person, but can be for other people in the merge letter)

Physics - 92

Can we have the field "Arts" being fully ommitted and "Physics" coming after "English"?

How can I do this on word through the rules?

Thanks in advance,

Claudia
Reply With Quote
  #2  
Old 06-18-2012, 02:33 PM
macropod's Avatar
macropod macropod is offline Mail Merge in Word: creating a rule for blanks Windows 7 64bit Mail Merge in Word: creating a rule for blanks 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 Claudia,

For each for the fields in question, you can use the \b and \f switches. See: http://office.microsoft.com/en-us/wo...005186172.aspx

Thus, if you select to 'Arts' mergefield and press Shift-F9, you should see something like:
{MERGEFIELD Arts}
If you change this to:
{MERGEFIELD Arts \b "Arts - " \f "¶
"}
where '¶' is an actual paragraph break, and delete the 'Arts - ' text before the mergefield, that line will only appear if your 'Arts' mergefield has any data.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 06-19-2012, 01:35 AM
cgranada cgranada is offline Mail Merge in Word: creating a rule for blanks Windows 7 32bit Mail Merge in Word: creating a rule for blanks Office 2007
Novice
Mail Merge in Word: creating a rule for blanks
 
Join Date: Jun 2012
Posts: 2
cgranada is on a distinguished road
Default

Thanks macropod. I can't seem to be able to make it though....

Let me give you the concrete detail, as an eg., this is what I put down according to your explanation:

Shift Allowance/Salary Addition €
{MERGEFIELD Salary_Add \b "Salary_Add 0" \f "¶
"}

Salary_Add being the field name and instead of a blank we have "0" (and we added in the currency, but it's not on merge function).

Let me know if you can help.
Thanks,

Claudia
Reply With Quote
  #4  
Old 06-19-2012, 01:57 AM
macropod's Avatar
macropod macropod is offline Mail Merge in Word: creating a rule for blanks Windows 7 64bit Mail Merge in Word: creating a rule for blanks 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 Claudia,

{MERGEFIELD Salary_Add \b "Shift Allowance/Salary Addition €" \f "¶
"}

However, if you need any particular numeric formatting in the mergefield, you'll need a different approach, as it seems Word can't apply numeric formatting along with the \b and \f switches. Instead, you can use an IF field test, constructed along the lines of:
{IF{MERGEFIELD Salary_Add }<> "" "Shift Allowance/Salary Addition { MERGEFIELD Salary_Add \# €,0.00}¶
"}

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from this message.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 02-24-2017, 09:51 AM
RHensley RHensley is offline Mail Merge in Word: creating a rule for blanks Windows 8 Mail Merge in Word: creating a rule for blanks Office 2013
Novice
 
Join Date: Feb 2017
Location: Baltimore, MD
Posts: 10
RHensley is on a distinguished road
Default Operators in Mail Merge for Rules

Hi All,

We are trying to find the mail merge operator rules that are used and placed in the mail merge rules. I need a list of the rules like what is \b, \f, and a list of all of the operators. Google isn't listing any.

Thanks so much !
Reply With Quote
  #6  
Old 02-24-2017, 07:40 PM
macropod's Avatar
macropod macropod is offline Mail Merge in Word: creating a rule for blanks Windows 7 64bit Mail Merge in Word: creating a rule for blanks 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

For fields in general, see:
https://support.office.com/en-us/art...ID=HA102110133
https://support.office.com/en-us/art...ID=HA101830917
For mergefields, see:
https://support.office.com/en-us/art...-1dc087daf4e6?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 02-27-2017, 09:08 AM
RHensley RHensley is offline Mail Merge in Word: creating a rule for blanks Windows 8 Mail Merge in Word: creating a rule for blanks Office 2013
Novice
 
Join Date: Feb 2017
Location: Baltimore, MD
Posts: 10
RHensley is on a distinguished road
Default Thank you for the information

Thanks Paul for all of you assistance it is great appreciated. Thanks again you have been so helpful.
Reply With Quote
Reply

Tags
merge rules, word 2007

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge in Word: creating a rule for blanks I need MS Word Mail Merge Help! mikecincotta Mail Merge 1 10-04-2010 05:22 PM
Need help creating a data base for mail merge. acedking90 Mail Merge 0 07-27-2009 11:04 AM
using word/able to fill blanks w/o moving rest Rath Word 3 03-07-2009 08:46 AM
Mail Merge in Word: creating a rule for blanks Word 2007 Mail Merge halfempty Mail Merge 1 03-03-2009 07:45 PM
mail merge in word help jngovols Mail Merge 0 04-07-2008 05:40 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:27 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