Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Mail Merge

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 06-24-2017, 10:26 PM
larry11 larry11 is offline Windows 10 Office 2016
Novice
 
Join Date: Jun 2017
Posts: 2
larry11 is on a distinguished road
Default Mail Merge Rules - IF, OR Function to Insert Specific text

Hello and Good Morning,

New to forum, so hello and Good Morning to all!

I was wondering if someone could please offer me some help.

I have a mail merge using Access as a data source and I am doing a merge to an email template I have set up.

I have set up the standard IF "Rules" in the word document where If the merge field = "This" insert "This Text", which works really well; however I have had to add numerous merge fields (over 20) to cover all possible text paragraphs that I may wish to insert although there are only usually 3 or 4 paragraphs that I need to add to each document.

I was wondering if instead of having individual merge fields for each paragraph whether I could have just a few merge fields but set up each paragraph so it would look in any of the mergefields for the "Trigger, basically using "OR" (or some other code/ formula)

So it would be a bit like this:
IF mergefied_1, OR Mergfield_2, OR mergefield_3 = "Yes" "then insert this text which is relevant to yes."



I could then use the same formula with another paragraph;

IF mergefied_1, OR Mergfield_2, OR mergefield_3 = "No" "Then add this text which is relevant to no"


Hopefully I have explained what I am looking for;

I thank you in anticipation of someone offering some much needed guidance!, I have searched the internet and do not seem to be able to find an answer or possible way to do this.

many thanks for your help.
Reply With Quote
  #2  
Old 06-25-2017, 04:21 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,755
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

You could use something like

{ SET A { MERGEFIELD Field1 } }{ SET B { MERGEFIELD Field2 } }{ SET C { MERGEFIELD Field3 }}
{ IF{ =({ IF { A } ="Yes" 1 0 }+{ IF { B } ="Yes" 1 0 }+{ IF { C } ="Yes" 1 0 }) } > 0 "then insert this text which is relevant to yes" }
{ IF{ =({ IF { A } ="No" 1 0 }+{ IF { B } ="No" 1 0 }+{ IF { C } ="No" 1 0 }) } > 0 "then insert this text which is relevant to No" }
__________________
Graham Mayor - MS MVP (Word)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 06-25-2017, 06:15 AM
larry11 larry11 is offline Windows 10 Office 2016
Novice
 
Join Date: Jun 2017
Posts: 2
larry11 is on a distinguished road
Default Rules

Hello,

Thank you for your response, I must admit I am a little confused, I can follow most of it but will have to sit down and try and understand it! I will send you an update with how I get on.

Thank you again for your very quick response,
Reply With Quote
Reply

Tags
merge rules, using if, using or

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge Using Rules "IF" to add additional Text Based On Merge Field Content Alfred Mail Merge 2 05-23-2017 10:59 PM
Learning Mail Merge Rules lawlaw Mail Merge 7 11-01-2014 08:51 PM
Insert Text Function-Default Cursor @ pg top sncw Word 1 11-20-2010 03:15 PM
Mail merge rules Barb D Mail Merge 0 03-18-2010 08:05 AM
Mail Merge If rules bordercollie10 Mail Merge 2 02-10-2009 12:43 PM


All times are GMT -7. The time now is 02:34 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft