So you are referring to the calendar color labels? They are not accessible with the Outlook object model, but can be accessed with CDO 1.21 or Redemption; see
http://www.outlookcode.com/codedetail.aspx?id=139 for sample code. The catch is that you must save the item before you can pass it over to CDO or Redemption. Generally, it's not a good idea to save an item with code in the Item_Write event handler, but maybe it would work with something like this:
Dim IsCheckingLabel
Function Item_Write()
If IsCheckingLabel = False Then
IsCheckingLabel = True
Item.Save
Else
' perform validation on calendar label, passing saved item to CDO or Redemption
IsCheckingLabel = False
End If
End Function
--
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/jumpstart.aspx
"Flemming" wrote in message ...
I am using the Appointment form as a the template for my personal form an the
field that I want to controle/verify on close of the form is the Label field!
Does that make any sence?
Kind regards
Flemming
"Sue Mosher [MVP-Outlook]" wrote:
Are you referring to the calendar color labels? I don't understand how that connects with your original question.
"Flemming" wrote in message ...
Hey Sue
Thank You, this was very helpfull!
But I still have a problem, why can I not change the "Label" field in a
standard Appointment form?
Flemming
"Sue Mosher [MVP-Outlook]" wrote:
Put code in the Item_Send event handler to check the property values (see http://www.outlookcode.com/d/propsyntax.htm). If they aren't what you want them to be, tell the user and set the return value of the function to False:
Function Item_Send()
If values are right Then
Item_Send = False
End If
End Function
"Flemming" wrote in message ...
Thank You for Your reply. But I was wondering if the validation would be
possible to do in VB scripting, since my validation is a bit more complex
than the validation tab allows.
"Sue Mosher [MVP-Outlook]" wrote:
The easiest way is to use the Validation tab on the Properties dialog for the control for each field.
"Flemming" wrote in message ...
All,
I have a custom form and I would like to make sure that sertain fields al
filled in correctly when the user saves it, how do I do that??