View Single Post
  #4  
Old June 8th 07, 05:00 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Custom Form - Checkboxes

The sample you saw showed how to get the value of an unbound check box with its Value property. You need just three more pieces to write all the code. Use the code window's Script | Event Handler to insert the Item_Write event handler. In that procedure, you'll want to test the value returned by the check box, and if it's True, append to the item's Categories property:

If CheckBox1.Value = True Then
Item.Categories = Item.Categories & ",Business"
End If


--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/article.aspx?id=54

"Scott07" wrote in message ...
I visited your link and noticed an article outlining how to use a checkbox to
show and hide a frame. I've removed the references to the frame since I
won't be needing that, but I don't know where to go with the Item_Write part
and how to make the act of checking the checkbox add it to the "Business"
category. This is for an unbound checkbox, by the way:

Sub CheckBox1_Click()
Set myinspector = Item.GetInspector
Set myPage1 = myInspector.ModifiedFormPages("Message")
Set Checkbox1 = myPage1.Controls("CheckBox1")
End Sub

Thanks.

"Sue Mosher [MVP-Outlook]" wrote:

You'll need to do this in code behind the form, in the Item_Write event handler, adding Business as a category if your criteria are met. How you get the values of the check boxes depends on whether the boxes are bound or unbound; see http://www.outlookcode.com/article.aspx?ID=38

"Scott07" wrote in message ...
Hi,

I'm attempting to create a custom contact form with 3 checkboxes that, when
checked, will add the form to a category (e.g. where Business, Competition,
Favorites, etc. are shown under "Available Categories"). For example, if the
checkboxes were named test1, test2, and test3; after those three were
checked, I'd like the form to be automatically classified under the
"Business" category.

Any help is appreciated.

Thanks.


Ads