PC Review


Reply
Thread Tools Rate Thread

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

 
 
=?Utf-8?B?RGV3ZXk=?=
Guest
Posts: n/a
 
      5th Jun 2007
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
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      6th Jun 2007
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.

--
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


"Dewey" <(E-Mail Removed)> wrote in message
news:2B9ED753-CEB4-4F47-ADAC-(E-Mail Removed)...
> 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


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Created contact list from existing address book-address book now e =?Utf-8?B?TGlhbQ==?= Microsoft Outlook Contacts 8 18th Feb 2007 06:49 PM
copy contact from ldap address book to personal address book =?Utf-8?B?RnZpZW5z?= Microsoft Outlook Contacts 0 10th Feb 2005 04:43 PM
exporting a windows address book to Outlook Personal address book Susan Microsoft Outlook Discussion 6 28th May 2004 12:12 AM
Re: Import contacts address book into main accounts address book Brian Tillman Microsoft Outlook 0 25th Mar 2004 02:57 PM
How do I import Windows Address Book entries into the Outlook 2003 Address Book? Mark Microsoft Outlook 2 3rd Jan 2004 06:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:46 AM.