Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Interop / June 2007

Tip: Looking for answers? Try searching our database.

Can't seem to get a name from the address book

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dewey - 05 Jun 2007 20:09 GMT
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
Ken Slovak - [MVP - Outlook] - 06 Jun 2007 00:37 GMT
Session.AddressBook returns CDO Recipients, not Outlook Recipients.

CDO isn't supported for .NET use. It might work, it might not, it might just
until you deploy your app and break at the customer site.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Hi
>  I'm trying to use a call to the AddressBookk function to bring up the
[quoted text clipped - 25 lines]
> Thanks for your help
> -Josh
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.