G
Guest
Hi
I'm trying to use a call to the AddressBookk function to bring up the
global address book and get a name. However, every time I put a name in the
"To" box in the Address List and click okay, the function returns as nothing.
Can somebody tell me what I'm doing wrong? I'm not being prompted for
security concerns, so I don't think it's that. Here's what I have: (This is
being done in VB.net btw):
Public Function AddressBook_Click(ByVal myChoice As String) As String
Dim objSession As Object 'As MAPI.Session
Dim objRecipients As Microsoft.Office.Interop.Outlook.Recipients
On Error Resume Next
objSession = CreateObject("MAPI.Session")
objSession.Logon(, , False, False)
objRecipients = objSession.AddressBook(, "Choose an address", True,
True, 1, "mychoice")
AddressBook_Click = objRecipients.Item(1).AddressEntry
End Function
Thanks for your help
-Josh
I'm trying to use a call to the AddressBookk function to bring up the
global address book and get a name. However, every time I put a name in the
"To" box in the Address List and click okay, the function returns as nothing.
Can somebody tell me what I'm doing wrong? I'm not being prompted for
security concerns, so I don't think it's that. Here's what I have: (This is
being done in VB.net btw):
Public Function AddressBook_Click(ByVal myChoice As String) As String
Dim objSession As Object 'As MAPI.Session
Dim objRecipients As Microsoft.Office.Interop.Outlook.Recipients
On Error Resume Next
objSession = CreateObject("MAPI.Session")
objSession.Logon(, , False, False)
objRecipients = objSession.AddressBook(, "Choose an address", True,
True, 1, "mychoice")
AddressBook_Click = objRecipients.Item(1).AddressEntry
End Function
Thanks for your help
-Josh