Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-12-2015, 12:16 PM
SoonerLater SoonerLater is offline IF... THEN... ELSE... rule to insert a Mailmerge Field Windows 7 64bit IF... THEN... ELSE... rule to insert a Mailmerge Field Office 2010 32bit
Novice
IF... THEN... ELSE... rule to insert a Mailmerge Field
 
Join Date: Sep 2015
Posts: 3
SoonerLater is on a distinguished road
Default IF... THEN... ELSE... rule to insert a Mailmerge Field

I need to create a mailmerge with this logic.



IF [mergefield OKtoPublish = "True"]
THEN insert [mergefield PhoneNumber]
ELSE insert ""

The If... Then... Else rule system lets you insert TEXT, not mergefields. However, it is a mergefield that I need to insert.

This thread in the UK Access Programmers Forum states:

Quote:
I'm using Word2003, embedded in the fundraising database Raiser's Edge (I know, I know - ::shudders:.

I am trying to formulate a field (I tried with a Word If...then...else field but I couldn't get it to work) that would conditionally insert a mail merge field (email address) if one of the other address fields was blank.

The problem is that the Word field if...then...else seems to only support plain text insertions. I tried editing the 'then' portion of the field after insertion with { MERGEFIELD email_address } in various forms, but I couldn't get it to work.
Quote:
Found your post while having similar issues. I found a workaround that works great for me. Just run the "If...Then...Else" wizard and put everything you want in it except the { MERGEFIELD email_address } part (use placeholder text in the "Insert this text" box to make it easy to find )

Then show the sourcecode in the word document (Alt+F9)

Then insert the { MERGEFIELD email_address } field using the typical method of clicking on "Insert Field" on the ribbon.

I couldn't find a difference between my manual coding and the coding MSWord made, but theirs worked ?!?!?!?! So give it a try and see if it helps.
After a lot of Googling, this above quotes were all I could find.

I've tried (I think) to implement the suggested solution, but I'll be darned if I can make it work.

Any suggestions?
Reply With Quote
  #2  
Old 09-12-2015, 08:10 PM
DougMVP DougMVP is offline IF... THEN... ELSE... rule to insert a Mailmerge Field Windows 7 32bit IF... THEN... ELSE... rule to insert a Mailmerge Field Office 2010 32bit
Advanced Beginner
 
Join Date: Nov 2013
Posts: 50
DougMVP will become famous soon enough
Default

You most certainly can use an If...then...Else field to insert the contents of a MergeField

For your example, insert the following mergefields and text

«OKtoPublish» = True «PhoneNumber» ""

then, select the above mergefields and text and press CTRL+F9 which will enclose it in a pair of field delimiters

{ «OKtoPublish» = True «PhoneNumber» "" }

Then insert the word IF as shown below

{ IF «OKtoPublish» = True «PhoneNumber» "" }

Then press ALT+F9 twice to toggle of the display of the field codes in the document.

Note: You MUST use CTRL+F9 to insert the field delimiters. It will NOT work if you insert the directly by the use of the { and } keys.
Reply With Quote
  #3  
Old 09-12-2015, 10:36 PM
macropod's Avatar
macropod macropod is offline IF... THEN... ELSE... rule to insert a Mailmerge Field Windows 7 64bit IF... THEN... ELSE... rule to insert a Mailmerge Field Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Quote:
Originally Posted by SoonerLater View Post
The If... Then... Else rule system lets you insert TEXT, not mergefields. However, it is a mergefield that I need to insert.
...
Any suggestions?
You might want to check out the 'Mailmerge Tips & Tricks' thread at the top of this forum to see how wrong you are about that!!!

For your scenario, all you need is a field coded as:
{IF«OKtoPublish»= True «PhoneNumber»}

Note: The field brace pairs (i.e. '{ }') for the above example are created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practicable to add them via any of the standard Word dialogues. Likewise, you can't type or copy & paste the chevrons (i.e. '« »') - they're part of the actual mergefields, which you can insert from the mailmerge toolbar. The spaces represented in the field construction are all required.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 09-13-2015, 03:52 PM
SoonerLater SoonerLater is offline IF... THEN... ELSE... rule to insert a Mailmerge Field Windows 7 64bit IF... THEN... ELSE... rule to insert a Mailmerge Field Office 2010 32bit
Novice
IF... THEN... ELSE... rule to insert a Mailmerge Field
 
Join Date: Sep 2015
Posts: 3
SoonerLater is on a distinguished road
Default

Thank you DougMVP and macropod for your help. Your suggestions worked brilliantly - and saved the day.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
IF... THEN... ELSE... rule to insert a Mailmerge Field Using IncludePicture and MailMerge to insert picture Elena Mail Merge 25 02-06-2022 05:35 PM
Removing Return from Address field in Mailmerge Formd Mail Merge 2 04-27-2015 10:07 PM
Mailmerge field format? Rothera85 Mail Merge 9 05-11-2014 03:41 PM
IF... THEN... ELSE... rule to insert a Mailmerge Field Mailmerge printing with field names Jvallee Mail Merge 9 04-16-2014 06:30 PM
IF... THEN... ELSE... rule to insert a Mailmerge Field Yes/No field does not work in mailmerge Abacus1234 Mail Merge 10 10-14-2013 06:37 AM

Other Forums: Access Forums

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