Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-30-2014, 09:03 AM
MikeStewart MikeStewart is offline Omit mergefield if it contains specific text Windows 7 64bit Omit mergefield if it contains specific text Office 2013
Novice
Omit mergefield if it contains specific text
 
Join Date: Sep 2014
Posts: 2
MikeStewart is on a distinguished road
Default Omit mergefield if it contains specific text

Hi,



Struggling with this... I want to omit my ADDRESS3 merge field if it contains the exact text "NO LOCALITY", but to merge it if it contains anything else.

(Word 2013, Windows 7 64bit.)

Thanks
Reply With Quote
  #2  
Old 09-30-2014, 02:53 PM
macropod's Avatar
macropod macropod is offline Omit mergefield if it contains specific text Windows 7 64bit Omit mergefield if it contains specific text Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,349
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

Try:
{IF{MERGEFIELD ADDRESS3}<> "NO LOCALITY" "{MERGEFIELD ADDRESS3}¶
"}
or:
{IF«ADDRESS3»<> "NO LOCALITY" "«ADDRESS3»¶
"}
where the ¶ is the actual line/paragraph break that terminates the existing Address3 line (this adds the end of the field code to whatever line follows your Address3 line).

Note: The field brace pairs (i.e. '{ }') for the above example are all 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
[MS MVP - Word]
Reply With Quote
  #3  
Old 10-01-2014, 01:15 AM
MikeStewart MikeStewart is offline Omit mergefield if it contains specific text Windows 7 64bit Omit mergefield if it contains specific text Office 2013
Novice
Omit mergefield if it contains specific text
 
Join Date: Sep 2014
Posts: 2
MikeStewart is on a distinguished road
Default

Thank you Paul,

The first example seems to work fine. I think my problem had been that I was typing the braces in rather than using Ctrl+F9

Only thing I can't figure out now is how to insert the ¶ that's in your instructions.

Regards

Mike
Reply With Quote
  #4  
Old 10-01-2014, 01:31 AM
macropod's Avatar
macropod macropod is offline Omit mergefield if it contains specific text Windows 7 64bit Omit mergefield if it contains specific text Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,349
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

Try pressing the ENTER key...
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Tags
mailmerge omit field

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Omit mergefield if it contains specific text Delete specific text Jackson Word VBA 16 12-06-2019 08:24 PM
How do I output text to a specific cell (x,y)? norwood Word VBA 2 01-31-2014 08:43 AM
Omit mergefield if it contains specific text Delete specific mass text on document JadeRisley Word 4 07-17-2013 11:11 PM
Omit mergefield if it contains specific text IF statement just generates text "MERGEFIELD" in document - what am I doing wrong? Eri Mail Merge 1 03-03-2012 03:03 PM
Omit mergefield if it contains specific text Mail Merge to print specific record based on mergefield criterias nicnad Mail Merge 1 02-22-2012 01:53 AM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 08:45 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft