Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

How can I create a macro that will highlight a dropdown menu sele.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
toptan - 09 Feb 2005 18:43 GMT
I am using Office 2002 to create a vacation request form that uses the
dropdown menu.  I would like to make the dropdown menu selection highlighted
if certain options are selected - so that those stand out from the rest of
the form.  (For example if a letter is selected instead of a number I want
the letter answer to be hightlighted in Yellow)  Is there a script or macro
that I can create and use on exit that will highlight if they select P
instead of 1 for example.
Greg - 09 Feb 2005 20:02 GMT
toptan,

Something like:

Sub HighLightFF()
Dim Drop As FormField

Set Drop = ActiveDocument.FormFields("DropDown1")

If Not (IsNumeric(Drop.Result)) Then
 With ActiveDocument
   .Sections(1).ProtectedForForms = False
   Drop.Range.HighlightColorIndex = wdYellow
   .Sections(1).ProtectedForForms = True
 End With

Else: With ActiveDocument
   .Sections(1).ProtectedForForms = False
   Drop.Range.HighlightColorIndex = wdNoHighlight
   .Sections(1).ProtectedForForms = True
 End With
   
End If
End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.