Sorry "zkid" for confusing the audience. But I've experienced that helpful
members of the audience never turn back to a thread they obvious see as
completed, and my follow-up questions have not been paid any attention.
However, now I have two problems.
The first one is that following code does not return any information from
the following elements: "<PR_STREET_ADDRESS>", "<PR_POSTAL_CODE>" and
"<PR_LOCALITY>". All other elements are returned without problems.
strFnamn = "<PR_GIVEN_NAME>"
strEnamn = "<PR_SURNAME>"
strTel = "<PR_HOME_TELEPHONE_NUMBER>"
strEpost = "<PR_EMAIL_ADDRESS>"
strMobil = "<PR_CELLULAR_TELEPHONE_NUMBER>"
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("", strCode, False, 1, , , True, True)
----------------------------------------------------------------------------
--
My second problem is that my attempt to add an adress fails. This is the
code:
Dim tagIDArray(0 To 8) As String
Dim valueArray(0 To 8) As String
tagIDArray(0) = "PR_DISPLAY_NAME"
tagIDArray(1) = "PR_GIVEN_NAME"
tagIDArray(2) = "PR_SURNAME"
tagIDArray(3) = "PR_HOME_TELEPHONE_NUMBER"
tagIDArray(4) = "PR_CELLULAR_TELEPHONE_NUMBER"
tagIDArray(5) = "PR_EMAIL_ADDRESS"
tagIDArray(6) = "PR_STREET_ADDRESS"
tagIDArray(7) = "PR_POSTAL_CODE"
tagIDArray(8) = "PR_LOCALITY"
valueArray(0) = cboTilltal.Text & " " & tbxEfternamn.Text
valueArray(1) = cboTilltal.Text
valueArray(2) = tbxEfternamn.Text
valueArray(3) = tbxFTelefon.Text
valueArray(4) = tbxFMobil.Text
valueArray(5) = tbxEpost.Text
valueArray(6) = tbxGata.Text
valueArray(7) = tbxPostNr.Text
valueArray(8) = tbxPostOrt.Text
Application.AddAddress TagID:=tagIDArray(), Value:=valueArray()
The result is a message saying that "It was not possible to add the address
to the private address book".
Hope again for your assistance.
/BosseH
zkid said:
Please go ahead and check out within VBA help the info. I sent you before for
GetAddress. Then, see the following line within that info. [For a list of
the valid address book property names, see the AddAddress method.] and click
on AddAddress for a complete list of available fields you can use with
Graham's code shown below:
strCode = "<PR_GIVEN_NAME> <PR_SURNAME>" & vbCr
strCode = strCode & "<PR_COMPANY_NAME>" & vbCr
strCode = strCode & "<PR_POSTAL_ADDRESS>" & vbCr
'Let the user choose the name in Outlook
strAddress = Application.GetAddress("", strCode, False, 1, , , True, True)
The VBA help function has a multitude of information, not to mention code
you can actually copy and paste in your modules.
zkid said:
Yes.
There are several ways, the easiest being through the address book if you
are just accessing the user's contacts and not delegated contacts from a
network.
From VBA help, type in GetAddress.