Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook Address Book Account details

Status
Not open for further replies.

MattSmithProg

Programmer
Sep 9, 2001
76
0
0
AU
Hi,

I have had this problem for a while now. I am attempting to get the properties of an individual via the Global address book.

What I have so far is this:

Sub AddName(txtNameBox As Object, strTitle As String)
Dim objSession As MAPI.Session
Dim objRecips As MAPI.Recipients

Set objSession = CreateObject("MAPI.Session")
objSession.Logon "default outlook profile"

Set objRecips = objSession.AddressBook(, "Select " & strTitle, , , 1, _
"Add " & strTitle, , , 0)

If Err.Number <> 0 Then
'No Users selected
Err.Clear
End If

txtNameBox.Value = objRecips(1)

objSession.Logoff
Set objRecips = Nothing
Set objSession = Nothing

End Sub

What I am attempting to do is from the person that the user selects get the cdoPR_ACCOUNT name.

Does anyone have any ideas how I could do this. I have tried creating an email message and entering the person's name and then the Fields.Item(&H3A00001E) property is available but then I run in to the problem of ambiguous names.

Any ideas???

Matt Smith

No two nulls are the same
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top