#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
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] |
#3
|
|||
|
|||
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 |
#4
|
||||
|
||||
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] |
#5
|
|||
|
|||
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 ! |
#6
|
||||
|
||||
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] |
#7
|
|||
|
|||
Thank you for the information
Thanks Paul for all of you assistance it is great appreciated. Thanks again you have been so helpful.
|
Tags |
merge rules, word 2007 |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
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 |
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 |