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 - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Tags: , , , ,

Populate combobox with public folder contact





 
 
Thread Tools Display Modes
  #1  
Old February 20th 06, 03:07 PM posted to microsoft.public.outlook.program_forms
Pazuzu
external usenet poster
 
Posts: 8
Default Populate combobox with public folder contact

Hi,

After some searching I found this article:
http://support.microsoft.com/default...;en-us;290818&

It's very nice, but what I need to do is populate the combobox with contacts
from a contacts folder stored under public folders... is there a way to do
this??
Ads
  #2  
Old February 20th 06, 03:21 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Populate combobox with public folder contact

To get a non-default folder, you need to walk the folder hierarchy using the Folders collections or use a function that does that for you. See http://www.outlookcode.com/d/code/getfolder.htm and, especially for public folders, http://www.outlookcode.com/codedetail.aspx?id=1164

After you have the folder, the technique is the same as in the article you cited.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Pazuzu" wrote in message ...
Hi,

After some searching I found this article:
http://support.microsoft.com/default...;en-us;290818&

It's very nice, but what I need to do is populate the combobox with contacts
from a contacts folder stored under public folders... is there a way to do
this??

  #3  
Old February 23rd 06, 11:42 AM posted to microsoft.public.outlook.program_forms
Pazuzu
external usenet poster
 
Posts: 8
Default Populate combobox with public folder contact

Thanks alot for your answer! All works fine! The only thing I can't manage to
do now is to get the names from the GAL.

My Contacts folder works fine with:
Set objSession = Application.GetNameSpace("MAPI")
Set objContactFolder = objSession.GetDefaultFolder(10)
Set objAllContacts = objContactFolder.Items

My public contacts folder works fine with:
Set objSession = Application.GetNameSpace("MAPI")
Set objContactFolder = GetPublicFolder("External contacts")
Set objAllContacts = objContactFolder.Items

But when I try this for the GAL...
Set objSession = Application.GetNameSpace("MAPI")
Const CdoAddressListGAL = 0
Set objAddressList = objSession.GetAddressList(CdoAddressListGAL)
Set objAddressEntries = objAddressList.AddressEntries

.... it fails with the erromessage:
Object doesn't support this property or method: 'objSession.GetAddressList'

Why oh why?

"Sue Mosher [MVP-Outlook]" wrote:

To get a non-default folder, you need to walk the folder hierarchy using the Folders collections or use a function that does that for you. See http://www.outlookcode.com/d/code/getfolder.htm and, especially for public folders, http://www.outlookcode.com/codedetail.aspx?id=1164

After you have the folder, the technique is the same as in the article you cited.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Pazuzu" wrote in message ...
Hi,

After some searching I found this article:
http://support.microsoft.com/default...;en-us;290818&

It's very nice, but what I need to do is populate the combobox with contacts
from a contacts folder stored under public folders... is there a way to do
this??


  #4  
Old March 7th 06, 02:35 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Populate combobox with public folder contact

Looks like you're confusing the Session objects in CDO 1.21 and Outlook. In Outlook, you must get the address list from the Namespace.AddressLists collection.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Pazuzu" wrote in message ...
Thanks alot for your answer! All works fine! The only thing I can't manage to
do now is to get the names from the GAL.

My Contacts folder works fine with:
Set objSession = Application.GetNameSpace("MAPI")
Set objContactFolder = objSession.GetDefaultFolder(10)
Set objAllContacts = objContactFolder.Items

My public contacts folder works fine with:
Set objSession = Application.GetNameSpace("MAPI")
Set objContactFolder = GetPublicFolder("External contacts")
Set objAllContacts = objContactFolder.Items

But when I try this for the GAL...
Set objSession = Application.GetNameSpace("MAPI")
Const CdoAddressListGAL = 0
Set objAddressList = objSession.GetAddressList(CdoAddressListGAL)
Set objAddressEntries = objAddressList.AddressEntries

... it fails with the erromessage:
Object doesn't support this property or method: 'objSession.GetAddressList'

Why oh why?


  #5  
Old March 15th 06, 11:27 AM posted to microsoft.public.outlook.program_forms
Pazuzu
external usenet poster
 
Posts: 8
Default Populate combobox with public folder contact

I hoped I wouldn't need CDO since I don't know what it is. But after some
researching/parrot-coding i found the solution, by changing the first two
lines to this:

Set objSession = CreateObject("MAPI.Session")
objSession.Logon "", "", False, False, 0

The only problem now is that is asks for permission to read the address book
but I will try to solve that with Outlook Redemption.

Thanks!

"Sue Mosher [MVP-Outlook]" skrev:

Looks like you're confusing the Session objects in CDO 1.21 and Outlook. In Outlook, you must get the address list from the Namespace.AddressLists collection.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Pazuzu" wrote in message ...
Thanks alot for your answer! All works fine! The only thing I can't manage to
do now is to get the names from the GAL.

My Contacts folder works fine with:
Set objSession = Application.GetNameSpace("MAPI")
Set objContactFolder = objSession.GetDefaultFolder(10)
Set objAllContacts = objContactFolder.Items

My public contacts folder works fine with:
Set objSession = Application.GetNameSpace("MAPI")
Set objContactFolder = GetPublicFolder("External contacts")
Set objAllContacts = objContactFolder.Items

But when I try this for the GAL...
Set objSession = Application.GetNameSpace("MAPI")
Const CdoAddressListGAL = 0
Set objAddressList = objSession.GetAddressList(CdoAddressListGAL)
Set objAddressEntries = objAddressList.AddressEntries

... it fails with the erromessage:
Object doesn't support this property or method: 'objSession.GetAddressList'

Why oh why?



 




Thread Tools
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
Populate Form with Outlook Contact Data Seagull Ng Outlook - Using Contacts 1 March 1st 06 02:56 PM
Distribution Lists in Public Contact Folder tgreco Outlook - Using Contacts 0 February 1st 06 02:51 PM
Populate Company field from Contact field in custom task form Sue Mosher [MVP-Outlook] Outlook - Using Forms 0 January 20th 06 08:37 PM
export a public contact folder to excel? mjb Outlook - Using Contacts 1 January 20th 06 06:44 AM
journal entries on public contact folder Melissa m Outlook - Using Contacts 3 January 18th 06 04:26 PM


All times are GMT +1. The time now is 10:04 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Loans - Mortgage Calculator - Credit Cards - Servidores - Quick Collect