![]() |
|
![]() |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
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 |
#2
|
||||
|
||||
![]()
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 |
#3
|
|||
|
|||
![]()
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.
|
#4
|
||||
|
||||
![]()
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] |
#5
|
|||
|
|||
![]()
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!
|
![]() |
Tags |
merged fields, nested merge |
|
![]() |
||||
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 |
![]() |
redzan | Mail Merge | 1 | 05-16-2013 08:34 AM |
![]() |
allenglishboy | Mail Merge | 9 | 03-05-2013 06:52 AM |
![]() |
ChrisPine | Mail Merge | 1 | 02-16-2012 10:01 PM |
![]() |
Calastein | Mail Merge | 3 | 05-04-2011 01:50 AM |