Change Outlook 2010 Field on Custom Form to Uppercase

In Outlook 2010 I have a custom form.  On this form I have a field named "For".  In this field my user enters someone's initials and I want this field to always show as uppercase regardless of how my user enters it.

This should be easy to do, but I cannot get it to work.  In researching this, I found you can use this formula on the Value tab of the control for that field:

UCase([For])

I'm not sure where on the value tab to place this to get it to work.

I'm open to any suggestions.

Thanks in advance!
Senniger1Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
David LeeConnect With a Mentor Commented:
Ok.  You'll need to add some code to the form to accomplish what you want.  Here's how to do that.

1.  Open the form in the form editor
2.  Click the "View Code" button the ribbon
3.  Copy and paste the code into the script editor
4.  Close the script editor
5.  Publish the form

The conversion to upper-case will not happen until you leave (e.g. click or tab out) the "For" field.  That's when the CustomPropertyChange event fires.  There is no way I know of to do this while typing since that action doesn't trigger any event we can trap and take some action on.

Sub Item_CustomPropertyChange(ByVal Name)
    If Name = "For" Then Item.UserProperties("For") = UCase(Item.UserProperties("For")) 
End Sub

Open in new window

0
 
David LeeCommented:
Hi, Senniger1.

When you say that the field is named "FOR", are you referring to the name of the control or the name of the field the control is connected to?
0
 
Senniger1Author Commented:
Actually it is both in my case, but for this purpose the name of the control is "For".  I created this field for this form (Type=Text and Properto to use=Value).
0
 
Senniger1Author Commented:
Exactly what I needed.  Thank you!
0
 
David LeeCommented:
You're welcome!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.