outlook forms

G

Guest

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?
 
G

Guest

Yes my form is based on a message form, and i'm using outlook 2002

where would i go to write the code? i had a quick look at your link, and i
find it a bit hard to follow! only because i am so unfamiliar with code,
would i for instance be looking at Built In properties, Custom properties or
Unbound Controls, to try and find out where the code that would be applicable
for me, be located?
 
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
 

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