RE: Combobox on an Outlook form with VBscript

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I modified my code to look like this:

Option Explicit
dim Control
function Item_Open()
dim Page
Set Page = Item.GetInspector.ModifiedFormPages("PickOne")
Set Control = Page.Controls("cbosubject")
'Set Control = Nothing
call subject
end function
sub subject()
Control.additem "Marketing"
Control.additem "Sales"

It is now working


"atwork" wrote:

> I am new to outlook and to programming so i am struggiling. I have had one VB
> class about 2 years ago. I am trying to fill a combobox with vbscript code.
> After reading a few articles and trying to peice everything together this is
> what i have done.
>
> Option Explicit
> dim Control
>
> Sub cbosubject_click()
> Set Page = Item.GetInspector.ModifiedFormPages("PickOne")
> Set Control = Page.Controls("cbosubject")
> Control.additem "Marketing"
> Control.additem "Sales"
> End sub
>
> PickOne is the name of the form and
> cbosubject is the name of the combobox
>
> The question or problem is when I run the form there is nothing in the
> combobox
>
> Thanks in advance
>
>
.



Relevant Pages

  • Re: combobox on a form with vbscript
    ... Ken Slovak [MVP - Outlook] http://www.slovaktech.com ... I am trying to fill a combobox with vbscript code. ... Set Page = Item.GetInspector.ModifiedFormPagesSet Control = Page.Controls ...
    (microsoft.public.office.developer.outlook.forms)
  • combobox on an outlook form with VBscript
    ... I am trying to fill a combobox with vbscript code. ... Sub cbosubject_click ... Set Control = Page.Controls ...
    (microsoft.public.outlook.program_forms)
  • combobox on a form with vbscript
    ... I am trying to fill a combobox with vbscript code. ... Sub cbosubject_click ... Set Control = Page.Controls ...
    (microsoft.public.office.developer.outlook.forms)
  • Re: combobox on a form with vbscript
    ... Option Explicit ... Set Control = Page.Controls ... > Reminder Manager, Extended Reminders, Attachment Options ...
    (microsoft.public.office.developer.outlook.forms)
  • Combobox on an Outlook form with VBscript
    ... I am trying to fill a combobox with vbscript code. ... Sub cbosubject_click ... Set Control = Page.Controls ...
    (microsoft.public.office.developer.vba)