outlook forms

M

maddy

I am trying to create simple code as I am a complete beginner to any sort of
code for my custom form. What i would like it to do is the following:

in a custom field called "Terms" which is a drop down list, If a certain
term is chosen, for my purposes this is called "Free Nomination" I would like
outlook to automatically send the form to our manager for approval.

Has anyone got any ideas? I have been messing around with the validation
tab in the properties box but don't really have an idea on what i am doing.

Thanks
 
S

Sue Mosher [MVP-Outlook]

Validation determines whether data is "good" or not. It doesn't perform any
additional actions, such as sending a message.

What you will need is code behind your form for the CustomPropertyChange
event. See http://www.outlookcode.com/d/propsyntax.htm for the syntax.

Is your form a message form? What version of Outlook?
 
S

Sue Mosher [MVP-Outlook]

As I said earlier, you would need to write code for the CustomPropertyChange
event. In design mode, choose Form, View Code to open the code window.

Since you are using Outlook 2002, you also need to be aware that you can't
send anything automatically without seeing a security prompt, so you may
want to display rather than send:

Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "Terms"
strMyProp1 = Item.UserProperties("Terms")
Select Case strMyProp1
Case "Free Nomination"

Item.To = "manager's address"
Item.Display
Case "Text2"
' code to react to the Terms
' string property having a value of "Text2"
Case Else
' code to handle other values of Terms
End Select
Case "MyProp2"
' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor
End Select
End Sub


I'd suggest that you play around with

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