A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to display Addressbook from VBA



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 7th 07, 07:27 PM posted to microsoft.public.outlook.program_vba
Maurice
external usenet poster
 
Posts: 48
Default How to display Addressbook from VBA

Hi,

I'm creating a userform in VBA and have a button placed next to a textfield.
What i'm trying to acomplish is that when the user clicks the button the
addressbook (for contacts) shows up and select the contact they would like.
When the addressbook is closed I want the selected emailaddresses to be
placed in my textbox.

So it's not the contacts folder that I want to see but the addressbook.

I know that this is standard functionality, but I need this for a project to
be implemented on a userform.

Any pointers in the right direction much appreciated...

Maurice
  #2  
Old May 7th 07, 09:36 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to display Addressbook from VBA

If you are using Outlook 2003 or earlier the only way to display the address
book is using CDO's Session.AddressBook method. You then have to convert
from the CDO objects returned to Outlook objects. CDO is an optional
installation for Outlook.

If you are using Outlook 2007 you can use the NameSpace.GetSelectNamesDialog
method.

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


"Maurice" wrote in message
news
Hi,

I'm creating a userform in VBA and have a button placed next to a
textfield.
What i'm trying to acomplish is that when the user clicks the button the
addressbook (for contacts) shows up and select the contact they would
like.
When the addressbook is closed I want the selected emailaddresses to be
placed in my textbox.

So it's not the contacts folder that I want to see but the addressbook.

I know that this is standard functionality, but I need this for a project
to
be implemented on a userform.

Any pointers in the right direction much appreciated...

Maurice


  #3  
Old May 8th 07, 06:08 PM posted to microsoft.public.outlook.program_vba
Maurice
external usenet poster
 
Posts: 48
Default How to display Addressbook from VBA

Ken,

Thanks for the reply. I was afraid if that (having to use CDO) but I was
hoping that there was maybe an easier way. But he if it's CDO then I just
have to start programming and enjoy that...

Maurice

"Ken Slovak - [MVP - Outlook]" wrote:

If you are using Outlook 2003 or earlier the only way to display the address
book is using CDO's Session.AddressBook method. You then have to convert
from the CDO objects returned to Outlook objects. CDO is an optional
installation for Outlook.

If you are using Outlook 2007 you can use the NameSpace.GetSelectNamesDialog
method.

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


"Maurice" wrote in message
news
Hi,

I'm creating a userform in VBA and have a button placed next to a
textfield.
What i'm trying to acomplish is that when the user clicks the button the
addressbook (for contacts) shows up and select the contact they would
like.
When the addressbook is closed I want the selected emailaddresses to be
placed in my textbox.

So it's not the contacts folder that I want to see but the addressbook.

I know that this is standard functionality, but I need this for a project
to
be implemented on a userform.

Any pointers in the right direction much appreciated...

Maurice



  #4  
Old May 8th 07, 11:53 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to display Addressbook from VBA

Look at the samples on www.cdolive.com\cdo5.htm, there are some there that
display the AB and convert the recipients into Outlook recipients.

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


"Maurice" wrote in message
news
Ken,

Thanks for the reply. I was afraid if that (having to use CDO) but I was
hoping that there was maybe an easier way. But he if it's CDO then I just
have to start programming and enjoy that...

Maurice


  #5  
Old May 9th 07, 09:10 PM posted to microsoft.public.outlook.program_vba
Maurice
external usenet poster
 
Posts: 48
Default How to display Addressbook from VBA

Ken,

Much appreciated here. That's the kind of tips that make life a lot easier.

Thanks

Maurice


"Ken Slovak - [MVP - Outlook]" wrote:

Look at the samples on www.cdolive.com\cdo5.htm, there are some there that
display the AB and convert the recipients into Outlook recipients.

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


"Maurice" wrote in message
news
Ken,

Thanks for the reply. I was afraid if that (having to use CDO) but I was
hoping that there was maybe an easier way. But he if it's CDO then I just
have to start programming and enjoy that...

Maurice



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Addressbook Deleted ColTom2 Outlook Express 6 March 9th 07 03:03 AM
add to addressbook? JethroUK© Outlook - General Queries 2 July 4th 06 02:04 AM
How to stop getting the Import addressbook display on startup! slowens Outlook - Using Contacts 15 May 25th 06 02:58 PM
transfer addressbook Arie van Outlook Express 1 January 16th 06 01:35 AM
how to display a form for the user to select a list of contacts from the addressbook LeAnne Outlook - General Queries 0 January 8th 06 01:55 PM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.