Code to change field color?

G

Greg Smith

I was searching the forums awhile back and came across a
post that showed how to change the color of a field.

I cannot seem to locate that post. Does anyone know the
code to change the color of a custom field?
 
G

Greg Smith

Under the advance properties, you can chage the backcolor.
The message that I found was if a user enters in incorrect
information into a field, you could use code to change the
field to a red color so the user knows which field is
incorrect.
-----Original Message-----
Can you be a little more specific about what you're
trying to do? Custom fields have data values. I'm not sure
where color fits into your needs.
 
J

John Ford

What you're really asking is how to change the backcolor of the CONTROL that DISPLAYS the field. In the world of Outlook Forms, a few "mysteries" are solved once you get used to the distinction of fields vs. controls.

In your code:

Set myControls = Item.GetInspector.ModifiedFormPages("Message").Controls
myControls("txtTextBox").BackColor = vbRed

--
jcf

| Under the advance properties, you can chage the backcolor.
| The message that I found was if a user enters in incorrect
| information into a field, you could use code to change the
| field to a red color so the user knows which field is
| incorrect.
|
| >-----Original Message-----
| >Can you be a little more specific about what you're
| trying to do? Custom fields have data values. I'm not sure
| where color fits into your needs.
| >--
| >Sue Mosher, Outlook MVP
| >Outlook and Exchange solutions at http://www.slipstick.com
| >Author of
| > Microsoft Outlook Programming: Jumpstart
| > for Administrators, Power Users, and Developers
| > http://www.slipstick.com/books/jumpstart.htm
| >
| >
| | >> I was searching the forums awhile back and came across
| a
| >> post that showed how to change the color of a field.
| >>
| >> I cannot seem to locate that post. Does anyone know the
| >> code to change the color of a custom field?
| >>
| >.
| >
 

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