Manipulating strings returned in merge

H

Harry

I am creating documents using merge fields and the output
of a program that I can't get rid of. The process is
automated so I can not edit the merge data before it is
included in the document. Names are formated either fn
mi. ln or ln/fn/mi . I only want ln (it's not available
from the program.) Is there some way to manipulate the
string that is returned from the merge field?
Thanks for your assistance.
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Harry,

You might be able to execute the merge to a catalog, or directory type main
document, then manipulate the data in that document before using it as the
basis for merging to your letter.

It is not clear whether the different formats that you mention are optional
or a mix over which you have no control.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
H

Harry

Thanks, Doug.

I'm not sure what you meant in your answer, but I
understand the request for clarity.

I am using a program that keeps track of personal
information related to litigation. The program generates,
internally, a merge data file and performs the merge to
yield a document. I can define the merge document format,
but the program contains all the merge fields internally.
Thus, even though I input last name, first name and middle
initial in separate places on a form, the program only has
merge fields for output as regular text (firstname
middleinitial. lastname) or formatted text
(lastname/firstname/middleinitial).

To create a letter, I want to use the last name only. I
can edit the resulting document, but that's inelegant, and
adds to the cost of producing the document. I would like
to get a subset of the regular text string or formatted
text string that is placed into the document by the
program.

I figured out a way to do it in WordPerfect by adding
about a page of codes to the beginning of each master
document template. But, WordPerfect has many other issues
that make is less desireable to use than Word.

I'm not sure that what I want to do can be done in Word.
If not, that's ok, I'd just like to know for sure one way
or the other.

Thanks for your prompt response.
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Harry,

If you choose the Lastname/FirstName/MiddleInitial format, then use a
Wildcard Edit>Replace with

([A-z']{2,})[/][A-z]{2,}[/][A-Z.]{1,}

in the find what control and

\1 in the replace with control, the Lastname/FirstName/MiddleInitial will be
replaced by only the Lastname.

See "Finding and replacing characters using wildcards" at:

http://word.mvps.org/FAQs/General/UsingWildcards.htm

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top