if checkbox is checked then...

G

Guest

hello,
in the 'general' page of contacts, i added a checkbox.
by default, the checkbox is not checked.
i would like to add code so that, when the checkbox is checked, the
'expertise' page i created next to the 'general' page is unhidden and data
can be entered there.
help is most appreciated.
thanks,
andy
 
S

Sue Mosher [MVP-Outlook]

The event that fires (and that you can write code for) depends on whether the check box is bound to an Outlook property or not. Tell us which, and in the meantime, see http://www.outlookcode.com/d/propsyntax.htm

The method you use to unhide a page is Inspector.ShowPage

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Sue, hi,

thanks for the link. i already had a look at your site previously: full of
interesting information. but for a newbee as me, it's difficult to see what
can solve my problem...
there's a large gap between using outlook and trying to customize it...
hope my motto 'learning by doing' helps me on my way.

your site contains a link to some code i adapted as follows:

Sub CheckBox1_Click()
Set myinspector = Item.GetInspector
Set myPage1 = myInspector.ModifiedFormPages("General")
Set myPage2 = myInspector.ModifiedFormPages("Expertise")
Set Checkbox1 = myPage1.Controls("CheckBox1")
myPage2.Visible = Checkbox1.Value
End Sub

i thought this would:
- identify the General page as myPage1
- identify the Expertise page (i created) as myPage2
- identify that the Check box is on the myPage1
- identify that, when the Check box is checked, myPage2 is visible

unfortunately, i get an error message 'Object required: myPage2'.
nice try... but not a success.
 
S

Sue Mosher [MVP-Outlook]

You're definitely on the right track, assuming that CheckBox1 is an unbound control, i.e. is not associated with an Outlook property.

But repeating what I said earlier, the method you use to unhide a page is Inspector.ShowPage, thus:

myInspector.ShowPage "Expertise"

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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