GetAddress does not provide all fields

B

Bo Hansson

I'm working with a Word VBA application in Office 2000 under Windows XP.

I may have spoiled the Outlook configuration when I tried to import contacts
from an earlier computer setup with Office 2003. At that occasion I got some
messages about incompatibility and nothing was imported. However, I can add
new contacts without problems. But when I try to use GetAddress in my Word
VBA code (or use the Insert Address command in the Word application) there
is nothing returned from the address fields of the chosen contact.

The following sample code (Word VBA) returns all fields, except for the last
three (
"<PR_STREET_ADDRESS>", "<PR_POSTAL_CODE>" and "<PR_LOCALITY>").
They are all empty.

Dim strAddress, strCode, strFnamn, strEnamn, strTel, strMobil, strEpost,
strGata, strPostNr, strOrt As String

strFnamn = "<PR_GIVEN_NAME>"
strEnamn = "<PR_SURNAME>"
strTel = "<PR_HOME_TELEPHONE_NUMBER>"
strMobil = "<PR_CELLULAR_TELEPHONE_NUMBER>"
strEpost = "<PR_EMAIL_ADDRESS>"
strGata = "<PR_STREET_ADDRESS>"
strPostNr = "<PR_POSTAL_CODE>"
strOrt = "<PR_LOCALITY>"

strCode = strFnamn & "$1" & strEnamn & "$2" & strTel & "$3" & strMobil &
"$4" & strEpost _
& "$5" & strGata & "$6" & strPostNr & "$7" & strOrt

strAddress = Application.GetAddress(AddressProperties:=strCode,
DisplaySelectDialog:=1)

MsgBox strAddress

------------------------------------------------

I have also tried to repair the pst file (SCANPST), and I have reinstalled
the complete Office 2000 - but I have not been able to get rid of the
problem.
Please, all Outlook experts, what should I do?

BosseH
 
E

Eric Legault [MVP - Outlook]

I'm not sure exactly how Word's GetAddress method works with multiple
addresses in a Contact. Can you verify how many address the problem Contact
has, and whether any of them are set as the mailing address? This may
indicate which is the default, and if there is no default, it's possible it
may return no address information.

Does the GetAddress method return empty strings for those three properties
for ALL your Contacts?
 
B

Bo Hansson

When applying GetAddress according to my Word VBA code, the user has to
select one of the contacts at a time. And the problem is the same for all
contacts.

/BosseH
 
B

Bo Hansson

Hi Eric

Sorry for misunderstanding you. When returning to this thread, I realise
that my previous response was not really related to your questions.
There is just one mail address (street, post code and city) in all of my
contacts, and that address is also marked as the mailing address.

I have now also had the opportunity to test my VBA application in another
computer with Outlook Express as mail handler.
And I encountered the same problem - no return of address fields. Is it
possible that the problem is with Word 2000 VBA?

/BosseH
 

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