PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Form Programming Re: Populating Combobox with GAL

Reply

Re: Populating Combobox with GAL

 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average.
Old 30-06-2003, 01:48 PM   #1
Robert Cohen
Guest
 
Posts: n/a
Default Re: Populating Combobox with GAL


I have Outlook 2002 (SP2)

It gives me an error at line 3 (Set objList =
Item.GetInspector.ModifiedFormPages("Message").ComboBox1)

But all it says is line 3 as the error. I don't get any error code or
anything.


--
My E-mail address is close to rcohen@yourfears.bbhtx.org. If you
need to e-mail me off list just get rid of "your fears" and
drop me a line.


"Sue Mosher [MVP]" <suemvp@slipstick.com> wrote in message
news:ebb3ZvZPDHA.4024@tk2msftngp13.phx.gbl...
What is the error message? Outlook version?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.slipstick.com/books/jumpstart.htm


"Robert Cohen" <jerrygarcia@gratefuldead.com> wrote in message
news:%23SX6f5KPDHA.2052@TK2MSFTNGP11.phx.gbl...
I found this code online to populate a combobox with the gal. But I can't
get it to work. I keep getting an error at line 3 (although I don't know if
there are more problems). Does anyone have any ideas.

Public Const CdoAddressListGAL = 0

' Create object reference to the combo box

Set objList = Item.GetInspector.ModifiedFormPages("Message").ComboBox1

objList.Clear

' Get global address list

Set objAddressList = objSession.GetAddressList(CdoAddressListGAL)

' Get address entries of the global address list

Set objAddressEntries = objAddressList.AddressEntries

' Loop through the address entries collection

For Each objAddressEntry In objAddressEntries

' Add each address entry to the combo box

objList.AddItem objAddressEntry.Name

Next



  Reply With Quote
Old 30-06-2003, 10:08 PM   #2
Sue Mosher [MVP]
Guest
 
Posts: n/a
Default Re: Populating Combobox with GAL

Try using the correct syntax for working with controls on Outlook forms:

Set objList = Item.GetInspector.ModifiedFormPages("Message").Controls("ComboBox1")

"Robert Cohen" <jerrygarcia@gratefuldead.com> wrote in message news:uwdvb5wPDHA.560@TK2MSFTNGP10.phx.gbl...
> I have Outlook 2002 (SP2)
>
> It gives me an error at line 3 (Set objList =
> Item.GetInspector.ModifiedFormPages("Message").ComboBox1)
>
> But all it says is line 3 as the error. I don't get any error code or
> anything.
>
>
> --
> My E-mail address is close to rcohen@yourfears.bbhtx.org. If you
> need to e-mail me off list just get rid of "your fears" and
> drop me a line.
>
>
> "Sue Mosher [MVP]" <suemvp@slipstick.com> wrote in message
> news:ebb3ZvZPDHA.4024@tk2msftngp13.phx.gbl...
> What is the error message? Outlook version?
> --
> Sue Mosher, Outlook MVP
> Outlook and Exchange solutions at http://www.slipstick.com
> Author of
> Microsoft Outlook Programming: Jumpstart
> for Administrators, Power Users, and Developers
> http://www.slipstick.com/books/jumpstart.htm
>
>
> "Robert Cohen" <jerrygarcia@gratefuldead.com> wrote in message
> news:%23SX6f5KPDHA.2052@TK2MSFTNGP11.phx.gbl...
> I found this code online to populate a combobox with the gal. But I can't
> get it to work. I keep getting an error at line 3 (although I don't know if
> there are more problems). Does anyone have any ideas.
>
> Public Const CdoAddressListGAL = 0
>
> ' Create object reference to the combo box
>
> Set objList = Item.GetInspector.ModifiedFormPages("Message").ComboBox1
>
> objList.Clear
>
> ' Get global address list
>
> Set objAddressList = objSession.GetAddressList(CdoAddressListGAL)
>
> ' Get address entries of the global address list
>
> Set objAddressEntries = objAddressList.AddressEntries
>
> ' Loop through the address entries collection
>
> For Each objAddressEntry In objAddressEntries
>
> ' Add each address entry to the combo box
>
> objList.AddItem objAddressEntry.Name
>
> Next
>
>
>

  Reply With Quote
Old 01-07-2003, 08:30 PM   #3
Robert Cohen
Guest
 
Posts: n/a
Default Re: Populating Combobox with GAL

I still get an error at that line with that code.

--
My E-mail address is close to rcohen@yourfears.bbhtx.org. If you
need to e-mail me off list just get rid of "your fears" and
drop me a line.


"Sue Mosher [MVP]" <suemvp@slipstick.com> wrote in message
news:u1d8on8PDHA.1556@TK2MSFTNGP10.phx.gbl...
Try using the correct syntax for working with controls on Outlook forms:

Set objList =
Item.GetInspector.ModifiedFormPages("Message").Controls("ComboBox1")

"Robert Cohen" <jerrygarcia@gratefuldead.com> wrote in message
news:uwdvb5wPDHA.560@TK2MSFTNGP10.phx.gbl...
> I have Outlook 2002 (SP2)
>
> It gives me an error at line 3 (Set objList =
> Item.GetInspector.ModifiedFormPages("Message").ComboBox1)
>
> But all it says is line 3 as the error. I don't get any error code or
> anything.
>
>
> --
> My E-mail address is close to rcohen@yourfears.bbhtx.org. If you
> need to e-mail me off list just get rid of "your fears" and
> drop me a line.
>
>
> "Sue Mosher [MVP]" <suemvp@slipstick.com> wrote in message
> news:ebb3ZvZPDHA.4024@tk2msftngp13.phx.gbl...
> What is the error message? Outlook version?
> --
> Sue Mosher, Outlook MVP
> Outlook and Exchange solutions at http://www.slipstick.com
> Author of
> Microsoft Outlook Programming: Jumpstart
> for Administrators, Power Users, and Developers
> http://www.slipstick.com/books/jumpstart.htm
>
>
> "Robert Cohen" <jerrygarcia@gratefuldead.com> wrote in message
> news:%23SX6f5KPDHA.2052@TK2MSFTNGP11.phx.gbl...
> I found this code online to populate a combobox with the gal. But I can't
> get it to work. I keep getting an error at line 3 (although I don't know

if
> there are more problems). Does anyone have any ideas.
>
> Public Const CdoAddressListGAL = 0
>
> ' Create object reference to the combo box
>
> Set objList = Item.GetInspector.ModifiedFormPages("Message").ComboBox1
>
> objList.Clear
>
> ' Get global address list
>
> Set objAddressList = objSession.GetAddressList(CdoAddressListGAL)
>
> ' Get address entries of the global address list
>
> Set objAddressEntries = objAddressList.AddressEntries
>
> ' Loop through the address entries collection
>
> For Each objAddressEntry In objAddressEntries
>
> ' Add each address entry to the combo box
>
> objList.AddItem objAddressEntry.Name
>
> Next
>
>
>



  Reply With Quote
Old 01-07-2003, 09:28 PM   #4
Sue Mosher [MVP]
Guest
 
Posts: n/a
Default Re: Populating Combobox with GAL

Check your form, then, to make sure that you have a page and control with exactly those names. What is the error description?

"Robert Cohen" <jerrygarcia@gratefuldead.com> wrote in message news:eVOWt%23AQDHA.1748@TK2MSFTNGP11.phx.gbl...
> I still get an error at that line with that code.
>
> "Sue Mosher [MVP]" <suemvp@slipstick.com> wrote in message
> news:u1d8on8PDHA.1556@TK2MSFTNGP10.phx.gbl...
> Try using the correct syntax for working with controls on Outlook forms:
>
> Set objList =
> Item.GetInspector.ModifiedFormPages("Message").Controls("ComboBox1")
>
> "Robert Cohen" <jerrygarcia@gratefuldead.com> wrote in message
> news:uwdvb5wPDHA.560@TK2MSFTNGP10.phx.gbl...
> > I have Outlook 2002 (SP2)
> >
> > It gives me an error at line 3 (Set objList =
> > Item.GetInspector.ModifiedFormPages("Message").ComboBox1)
> >
> > But all it says is line 3 as the error. I don't get any error code or
> > anything.
> >
> >
> > --
> > My E-mail address is close to rcohen@yourfears.bbhtx.org. If you
> > need to e-mail me off list just get rid of "your fears" and
> > drop me a line.
> >
> >
> > "Sue Mosher [MVP]" <suemvp@slipstick.com> wrote in message
> > news:ebb3ZvZPDHA.4024@tk2msftngp13.phx.gbl...
> > What is the error message? Outlook version?
> > --
> > Sue Mosher, Outlook MVP
> > Outlook and Exchange solutions at http://www.slipstick.com
> > Author of
> > Microsoft Outlook Programming: Jumpstart
> > for Administrators, Power Users, and Developers
> > http://www.slipstick.com/books/jumpstart.htm
> >
> >
> > "Robert Cohen" <jerrygarcia@gratefuldead.com> wrote in message
> > news:%23SX6f5KPDHA.2052@TK2MSFTNGP11.phx.gbl...
> > I found this code online to populate a combobox with the gal. But I can't
> > get it to work. I keep getting an error at line 3 (although I don't know

> if
> > there are more problems). Does anyone have any ideas.
> >
> > Public Const CdoAddressListGAL = 0
> >
> > ' Create object reference to the combo box
> >
> > Set objList = Item.GetInspector.ModifiedFormPages("Message").ComboBox1
> >
> > objList.Clear
> >
> > ' Get global address list
> >
> > Set objAddressList = objSession.GetAddressList(CdoAddressListGAL)
> >
> > ' Get address entries of the global address list
> >
> > Set objAddressEntries = objAddressList.AddressEntries
> >
> > ' Loop through the address entries collection
> >
> > For Each objAddressEntry In objAddressEntries
> >
> > ' Add each address entry to the combo box
> >
> > objList.AddItem objAddressEntry.Name
> >
> > Next
> >
> >
> >

>
>

  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

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