Control Scripting in item forms

R

Ron Matuszek

I've created a custom contact form. I've added controls from the standard
toolbox to the custom page. When I press a button the Script
"CommandButton1_Click" event fires and the subroutine is processed. But, when
I try to capture the change events for a tab strip or a multipage or a spin
button the script doesn't recognize these objects or their events.

For example, in a VBA form the tabstrip fires a TabStrip1_Change event when
you select a diferent tab. I can use the TabStrip1.Value property to
determine which tab is active and update the appropriate controls as needed.
When I try this in the VBScript within the customized Contact form I can't
even read the TabStrip1.Value property. I get an "Object Required" error.

Here's the script:
---------------------------------
Sub CommandButton1_Click()
MsgBox "The Button was clicked." & SpinButton1.Value
End Sub

Sub SpinButton1_Click()
MsgBox "Spin Button Clicked"
End Sub

Sub SpinButton1_Change()
MsgBox "Spin Button Changed"
End Sub
-----------------------------------
When I run the form the Command Button Clink event fires but I get an
"Object Required: 'SpinButton1'" error instead of a message box with the
value of the spin button. The Spin Button Change and Click event handlers are
ignored.

I'm using Outlook 2003. Are the standard controls available in VBScript? If
so, am I trying to access them incorrectly?
 
R

Ron Matuszek

Sue:

Thanks for the response. I think Microsoft should remove all of the controls
that don't work from the outlook toolbox. In other words, everything except
the command button.

Ron
 
S

Sue Mosher [MVP-Outlook]

Huh? Just because those controls don't raise the events you want doesn't mean they don't work as intended for Outlook forms.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
R

Ron Matuszek

Sue:

In VBA and all other MS forms a TabStrip allows you to respond when the user
selects a different tab. The Change event fires and you update the shared
controls to reflect the information that correlates to the selected tab. If
Outlook doesn't let you know in a reliable fashion that the user has selected
a different tab you can't update the shared controls and the TabStrip becomes
useless! The same goes for the spin button. How can these controls be
"working as intended?" With all of the use a PIM gets, it plays a central
role in a user’s day. I can't understand why Microsoft hasn't made Outlook's
automation environment as reliable as the one they did with Excel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top