Grabbing information from a previous entry in autonew macro

G

Guest

Here is what I need to do. I need to enter an address into a document based
on a users selection with a listbox. It drops the information into the
document, which is fine, but then later in the document, I need to grab the
person's name from that information, and insert it elsewhere into the
document. How can I accomplish this task? Any suggestions? It would be
like this, First Last then a comma. I need to grab the first and last,
before the comma. Not all names of course are the same length. Thanks in
advance for any, and all help!

Brian
 
C

Cindy M.

Hi =?Utf-8?B?VHJlZmlsb3YyMg==?=,
Here is what I need to do. I need to enter an address into a document based
on a users selection with a listbox. It drops the information into the
document, which is fine, but then later in the document, I need to grab the
person's name from that information, and insert it elsewhere into the
document. How can I accomplish this task? Any suggestions? It would be
like this, First Last then a comma. I need to grab the first and last,
before the comma. Not all names of course are the same length.
This newsgroup is targeted at end-users. You'll have better luck getting a
quick and knowledgeable reply in one of the word.vba newsgroups. Be sure to
mention the version of Word when you post a question.

There are a number of possible ways this can be done, but to follow up on the
approach you're considering: look up the Instr function in the VBA help. You
can use the value this returns when you test for the comma in combination with
the Left or Mid functions to get just part of a string.

If you're interested in other approaches, or need to follow-up, please use a
word.vba newsgroup, and include information on how you're populating the list
box with the information.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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