madchemist
Board Regular
- Joined
- Jul 10, 2006
- Messages
- 198
I am trying to write a macro to change the text color in a forms textbox. I need the textbox to have blue instructions in it, and then turn into black text after the user enters information.
I have quite a bit of experience working with excel macros, but feel stupid that I cannot figure this out. I put this macro in the textboxes properties upon exit, but it doesnt change the text color.
Any ideas? I would prefer to leave it generic to the textbox it is on instead of specifically calling out a textbox to change. I would like to use this in a few areas....
thanks!
I have quite a bit of experience working with excel macros, but feel stupid that I cannot figure this out. I put this macro in the textboxes properties upon exit, but it doesnt change the text color.
Any ideas? I would prefer to leave it generic to the textbox it is on instead of specifically calling out a textbox to change. I would like to use this in a few areas....
thanks!
Code:
Sub TextChange()
ActiveDocument.Unprotect
Selection.Font.ColorIndex = 1
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
End Sub