Pulling Middle Initial and Suffix from Address Book

C

Cameron Powell

I have looked everywhere for an answer to this, but I can't seem to come up
with anything. I have a macro that will pull the mailing address of a person
over into a blank TextBox on a UserForm. The problem being I dont know what
command to use to get the Middle Initial and Suffix...

Ex. strAddress = Application.GetAddress(strName, "<PR_DISPLAY_NAME_PREFIX>
<PR_GIVEN_NAME> <PR_SURNAME>" & vbCr & "<PR_TITLE>" & vbCr &
"<PR_COMPANY_NAME>" & vbCr & "<PR_STREET_ADDRESS>" & vbCr & "<PR_LOCALITY>,
<PR_STATE_OR_PROVINCE>" & " " & "<PR_POSTAL_CODE>", , 2)

Result:
Mr. John Doe <-- Should be Mr. John E. Doe, Sr.
President
JD Enterprises
111 SW Somewhere
Nowheresville, MI 98765
 
D

Doug Robbins - Word MVP

From where is the data being pulled?

Probably <PR_INITIALS> and <PR_SUFFIX>, though the initials may be
<PR_MIDDLE_NAME>

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
C

Cameron Powell

It's being pulled from an outlook address book. I tried all three of those
and none of them worked... I would also like to know if there is a way to
store the middle initial and suffix. Something went wrong with our address
books and somehow the First, Last, and Middle Initials are appearing in the
wrong places. Instead of manually going through the whole book and retyping
all the info. I was hoping that there would be a way that I could just see
what it is currently displayed as, and have it show a list of different
options to change it to. Then I could click a button labeled change and it
would update the information.

Example:
Mr. John E. Doe, Esq. could display in the address book as:

Suffix: Mr.
First: E. Doe
Middle:
Last: John
Suffix: Esq.

I would like to have a userform that would who that info, then list a few
possible combos of what it could be changed to. Is this even possible? Or
should I just start manually re-entering all of the correct info?
 
G

Graham Mayor

Only a subset of the Outlook fields is available using this method. A simple
answer is to ensure that the FileAs field is edited to contain the
information you want and use the DISPLAY_NAME field as indicated in one of
your other threads. A list of available fields is provided at
http://www.gmayor.com/Macrobutton.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - 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