Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-23-2017, 05:11 AM
Kimu Kimu is offline Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? Windows 7 32bit Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? Office 2007
Novice
Is there a simpler way to get the first 2 characters of a field to appear in a mail merge?
 
Join Date: Oct 2014
Posts: 5
Kimu is on a distinguished road
Default Is there a simpler way to get the first 2 characters of a field to appear in a mail merge?

Hello



I'm doing a mail merge, and one of the fields is called 'Staff ID'. The data in this field appears as JSMITH, KBROWN, EJONES, etc. I would like this data to appear just as the initials of the staff name, e.g. JS, KB, EJ, etc. In other words, I'd like it to show just the first two characters of this field.

At the moment, I am using "if... then... else" clauses:

{ IF { MERGEFIELD Staff_ID } = "JSMITH" "JS"
{ IF { MERGEFIELD Staff_ID } = "KBROWN" "KB"
{ IF { MERGEFIELD Staff_ID } = "EJONES" "EJ"
"blank" }"}"}

However, this is not ideal as I have to update the mail merge template every time a new person arrives, and there are already about 15 different staff. (I've just used 3 here as an example.) Also, this merged field appears in a table with a narrow column, so it is difficult to see and edit the full merged field text.

So my question is, is there a simpler way to force the mail merge to show only the first two characters of this field?

I've tried looking through this forum for answers to similar questions, but the only one that I could find just suggested the method that I'm currently using...

I'd be very grateful for any help that anyone can offer!

Thank you

Kim
Reply With Quote
  #2  
Old 03-23-2017, 07:02 AM
gmayor's Avatar
gmayor gmayor is offline Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? Windows 10 Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? 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 cannot merge part of a field. The obvious solution is to add an initials field to the data source.
__________________
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 03-23-2017, 09:05 AM
Kimu Kimu is offline Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? Windows 7 32bit Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? Office 2007
Novice
Is there a simpler way to get the first 2 characters of a field to appear in a mail merge?
 
Join Date: Oct 2014
Posts: 5
Kimu is on a distinguished road
Default

Ah, that's a shame - but at least it's help to know that it can't be done. Thank you for taking the time to respond.
Reply With Quote
  #4  
Old 03-23-2017, 03:56 PM
macropod's Avatar
macropod macropod is offline Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? Windows 7 64bit Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? 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

You could do it with 52 IF tests for all records:
{IF{MERGEFIELD Staff_ID = "A*" "A"}{IF{MERGEFIELD Staff_ID}= "B*" "B"}{IF{MERGEFIELD Staff_ID = "C*" "C"} ... {IF{MERGEFIELD Staff_ID}= "Z*" "Z"}
for the first letter, and
{IF{MERGEFIELD Staff_ID = "?A*" "A"}{IF{MERGEFIELD Staff_ID}= "?B*" "B"}{IF{MERGEFIELD Staff_ID = "?C*" "C"} ... {IF{MERGEFIELD Staff_ID}= "?Z*" "Z"}
for the second letter.

I'm with Graham on this one though - simpler to modify the data source.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 03-24-2017, 02:42 AM
Kimu Kimu is offline Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? Windows 7 32bit Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? Office 2007
Novice
Is there a simpler way to get the first 2 characters of a field to appear in a mail merge?
 
Join Date: Oct 2014
Posts: 5
Kimu is on a distinguished road
Default

That's a clever idea! I'll have a think about that one, given that I can't edit the underlying data source in this case. Many thanks!
Reply With Quote
Reply

Tags
merged fields, nested merge

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail merge how to link mail merge field value to a column heading dsummers Mail Merge 1 05-08-2014 02:59 PM
Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? How to ignore a mail merge field if the field is blank redzan Mail Merge 1 05-16-2013 08:34 AM
Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? mail merge (more than 255 characters) allenglishboy Mail Merge 9 03-05-2013 06:52 AM
Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? Access to Word Mail Merge Issue (255 characters) ChrisPine Mail Merge 1 02-16-2012 10:01 PM
Is there a simpler way to get the first 2 characters of a field to appear in a mail merge? Characters changing between software and mail merge output?? Calastein Mail Merge 3 05-04-2011 01:50 AM

Other Forums: Access Forums

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