Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Mail Merge

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 03-23-2017, 05:11 AM
Kimu Kimu is offline Windows 7 32bit Office 2007
Novice
 
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 Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,702
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
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)
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 Windows 7 32bit Office 2007
Novice
 
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 Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,191
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
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
[MS MVP - Word]
Reply With Quote
  #5  
Old 03-24-2017, 02:42 AM
Kimu Kimu is offline Windows 7 32bit Office 2007
Novice
 
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
How to ignore a mail merge field if the field is blank redzan Mail Merge 1 05-16-2013 08:34 AM
mail merge (more than 255 characters) allenglishboy Mail Merge 9 03-05-2013 06:52 AM
Access to Word Mail Merge Issue (255 characters) ChrisPine Mail Merge 1 02-16-2012 10:01 PM
Characters changing between software and mail merge output?? Calastein Mail Merge 3 05-04-2011 01:50 AM


All times are GMT -7. The time now is 01:25 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft