Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-24-2017, 10:26 PM
larry11 larry11 is offline Mail Merge Rules - IF, OR Function to Insert Specific text Windows 10 Mail Merge Rules - IF, OR Function to Insert Specific text Office 2016
Novice
Mail Merge Rules - IF, OR Function to Insert Specific text
 
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 Mail Merge Rules - IF, OR Function to Insert Specific text Windows 10 Mail Merge Rules - IF, OR Function to Insert Specific text Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
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) (2002-2019)
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 Mail Merge Rules - IF, OR Function to Insert Specific text Windows 10 Mail Merge Rules - IF, OR Function to Insert Specific text Office 2016
Novice
Mail Merge Rules - IF, OR Function to Insert Specific text
 
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 Rules - IF, OR Function to Insert Specific text 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 Rules - IF, OR Function to Insert Specific text Mail Merge If rules bordercollie10 Mail Merge 2 02-10-2009 12:43 PM

Other Forums: Access Forums

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