PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Form Programming
Re: Populating Combobox with GAL
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Form Programming
Re: Populating Combobox with GAL
![]() |
Re: Populating Combobox with GAL |
|
|
Thread Tools |
Rating:
|
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 > > > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 > > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
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 > > > > > > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 


