Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-06-2012, 12:43 PM
CharlieVW CharlieVW is offline Substituting a value using MERGEFIELD Windows 7 64bit Substituting a value using MERGEFIELD Office 2010 64bit
Novice
Substituting a value using MERGEFIELD
 
Join Date: May 2012
Posts: 2
CharlieVW is on a distinguished road
Default Substituting a value using MERGEFIELD

My Excel 2010 spread sheet's source data field contains a value of "YES" or "NO". My Word 2010 template's merge field causes either "YES" or "NO" to appear in its place in the merged document. Is there a way to define the merge field to cause the word "email" to be inserted instead of "YES" and for "hardcopy" to be inserted instead of "NO"?
Reply With Quote
  #2  
Old 05-06-2012, 10:11 PM
macropod's Avatar
macropod macropod is offline Substituting a value using MERGEFIELD Windows 7 64bit Substituting a value using MERGEFIELD Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Hi Charlie,

You can use an IF field, coded along the lines of:
{IF«MyField»= "YES" "email" "hardcopy"}
where 'MyField' is the field name in your data.

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message. Likewise, you can't type or copy & paste the chevrons (ie '« »') - they're part of the actual mergefields, which you can insert from the mailmerge toolbar.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-07-2012, 05:52 AM
CharlieVW CharlieVW is offline Substituting a value using MERGEFIELD Windows 7 64bit Substituting a value using MERGEFIELD Office 2010 64bit
Novice
Substituting a value using MERGEFIELD
 
Join Date: May 2012
Posts: 2
CharlieVW is on a distinguished road
Smile

Paul - Thanks so much! I'm taking your "IF..." statement to mean, "If the field contains "Yes," substitute "electronic" and otherwise substitute "hardcopy". I'll try to acquire a better understanding of how "IF..." works. Thanks again for putting me on the right track.
Reply With Quote
  #4  
Old 05-07-2012, 12:11 PM
Charles Kenyon Charles Kenyon is offline Substituting a value using MERGEFIELD Windows Vista Substituting a value using MERGEFIELD Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,083
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

See the Field Codes Reference for IF Field
{ IF Expression1 Operator Expression2 TrueText FalseText }


Sometimes quotation marks around things are needed since the field uses spaces as delimiters.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Substituting a value using MERGEFIELD Word vs Excel (NEXTIF, SKIPIF mergefield) jerry00769 Mail Merge 3 04-30-2012 03:43 PM
Substituting a value using MERGEFIELD Mergefield IF/ELSE determin source type legg1 Mail Merge 6 03-26-2012 09:18 PM
Mail Merge to multiple .doc files named after a mergefield nicnad Mail Merge 1 02-22-2012 01:59 AM
Substituting a value using MERGEFIELD Mail Merge to print specific record based on mergefield criterias nicnad Mail Merge 1 02-22-2012 01:53 AM
Mergefield date error michielvanderbiest Mail Merge 1 04-12-2010 11:22 PM

Other Forums: Access Forums

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