PC Review


Reply
Thread Tools Rate Thread

combobox on an outlook form with VBscript

 
 
=?Utf-8?B?YXR3b3Jr?=
Guest
Posts: n/a
 
      28th Apr 2005
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

Thanks in advance


 
Reply With Quote
 
 
 
 
=?Utf-8?B?YXR3b3Jr?=
Guest
Posts: n/a
 
      29th Apr 2005
More info
When i run the form nothing appears in the combobox. I have saved the form
and posted the form. Is there something wrong with my code or am i missing a
step regarding the form?

"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
>
> Thanks in advance
>
>

 
Reply With Quote
 
Hollis D. Paul
Guest
Posts: n/a
 
      30th Apr 2005
In article <E9E30405-10C7-4B66-AD7A-(E-Mail Removed)>,
=?Utf-8?B?YXR3b3Jr?= wrote:
> Set Page = Item.GetInspector.ModifiedFormPages("PickOne")
> Set Control = Page.Controls("cbosubject")
> Control.additem "Marketing"
> Control.additem "Sales"
>

It looks like you should be putting that in the Item_Open function.
Then you publish the form to the appropriate forms library, or your
inbox. You don't really save a form design--instead, you publish it.
You can test the form by clicking the Action menu, choosing run this
form, and seeing how it executes. When done with the test, you delete
it without saving, or it becomes a bit of trash in your default folder.

You publish from the Tools menu: Click Tools --> Forms --> Publish
Forms as and then follow the wizard. Always use Publish As, so that
you can include the version number in the new form name--myform_ver101.
This will prevent the forms cache problem where you swear you
published a new version but when you select the name you get the old
version.

With respect to your code, the Primary Resources for coding information
on the web is www.slipstick.com, www.outlook-tips.net,
www.outlookcode.com. Lesser resources are the web sites of other
Outlook MVPs, a short list of which can be found at:
http://www.outlookbythesound.com/SBS...et_outlook.htm, hold
your mouse over the blossoms and buds, and the site name will appear in
the tool-tip.

Hollis D. Paul [MVP - Outlook]
(E-Mail Removed)
Mukilteo, WA USA


 
Reply With Quote
 
=?Utf-8?B?YXR3b3Jr?=
Guest
Posts: n/a
 
      2nd May 2005
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 - Thanks for your help


"Hollis D. Paul" wrote:

> In article <E9E30405-10C7-4B66-AD7A-(E-Mail Removed)>,
> =?Utf-8?B?YXR3b3Jr?= wrote:
> > Set Page = Item.GetInspector.ModifiedFormPages("PickOne")
> > Set Control = Page.Controls("cbosubject")
> > Control.additem "Marketing"
> > Control.additem "Sales"
> >

> It looks like you should be putting that in the Item_Open function.
> Then you publish the form to the appropriate forms library, or your
> inbox. You don't really save a form design--instead, you publish it.
> You can test the form by clicking the Action menu, choosing run this
> form, and seeing how it executes. When done with the test, you delete
> it without saving, or it becomes a bit of trash in your default folder.
>
> You publish from the Tools menu: Click Tools --> Forms --> Publish
> Forms as and then follow the wizard. Always use Publish As, so that
> you can include the version number in the new form name--myform_ver101.
> This will prevent the forms cache problem where you swear you
> published a new version but when you select the name you get the old
> version.
>
> With respect to your code, the Primary Resources for coding information
> on the web is www.slipstick.com, www.outlook-tips.net,
> www.outlookcode.com. Lesser resources are the web sites of other
> Outlook MVPs, a short list of which can be found at:
> http://www.outlookbythesound.com/SBS...et_outlook.htm, hold
> your mouse over the blossoms and buds, and the site name will appear in
> the tool-tip.
>
> Hollis D. Paul [MVP - Outlook]
> (E-Mail Removed)
> Mukilteo, WA USA
>
>
>

 
Reply With Quote
 
=?Utf-8?B?YXR3b3Jr?=
Guest
Posts: n/a
 
      2nd May 2005
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 - Thanks for your help


"Hollis D. Paul" wrote:

> In article <E9E30405-10C7-4B66-AD7A-(E-Mail Removed)>,
> =?Utf-8?B?YXR3b3Jr?= wrote:
> > Set Page = Item.GetInspector.ModifiedFormPages("PickOne")
> > Set Control = Page.Controls("cbosubject")
> > Control.additem "Marketing"
> > Control.additem "Sales"
> >

> It looks like you should be putting that in the Item_Open function.
> Then you publish the form to the appropriate forms library, or your
> inbox. You don't really save a form design--instead, you publish it.
> You can test the form by clicking the Action menu, choosing run this
> form, and seeing how it executes. When done with the test, you delete
> it without saving, or it becomes a bit of trash in your default folder.
>
> You publish from the Tools menu: Click Tools --> Forms --> Publish
> Forms as and then follow the wizard. Always use Publish As, so that
> you can include the version number in the new form name--myform_ver101.
> This will prevent the forms cache problem where you swear you
> published a new version but when you select the name you get the old
> version.
>
> With respect to your code, the Primary Resources for coding information
> on the web is www.slipstick.com, www.outlook-tips.net,
> www.outlookcode.com. Lesser resources are the web sites of other
> Outlook MVPs, a short list of which can be found at:
> http://www.outlookbythesound.com/SBS...et_outlook.htm, hold
> your mouse over the blossoms and buds, and the site name will appear in
> the tool-tip.
>
> Hollis D. Paul [MVP - Outlook]
> (E-Mail Removed)
> Mukilteo, WA USA
>
>
>

 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook , VBScript e html form.. HELP .-=] ExTrEmE [=-. Microsoft Outlook VBA Programming 7 30th Oct 2007 06:40 PM
Outlook form with vbscript =?Utf-8?B?Q29yZXkgSC4=?= Microsoft Outlook Form Programming 11 15th Sep 2006 11:36 PM
Outlook form with VBScript saved as an OFT? Sydney Microsoft Outlook Form Programming 1 24th Mar 2006 05:51 AM
Using FileDialog in vbscript for Outlook form? Andrea Microsoft Outlook Form Programming 0 1st Dec 2004 12:16 AM
Outlook 2003 won't run vbscript in published form Marty Peterson Microsoft Outlook Form Programming 11 16th Sep 2004 09:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:47 AM.