View Single Post
  #3   Report Post  
Posted to microsoft.public.word.newusers
Beth Melton Beth Melton is offline
external usenet poster
 
Posts: 1,380
Default Drop down field formatting

Out of curiosity, why did you elect to use: Case Is="Not Selected" instead
of Case "Not Selected"?

I've always seen Is be used for comparison operators in a Case statement.
Something like Case Is 50.

Also note that Select Case is case-sensitive so if SELECTED is in uppercase
in the dropdown then it needs to be the same in the macro.

Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/

"Greg Maxey" wrote in message
...
Something like this should do. Set the macro to run on exit from the
dropdown field:

Sub FormatResult()
Dim oFF As FormField
ActiveDocument.Unprotect
Set oFF = Selection.FormFields(1)
Select Case oFF.Result
Case Is = "Selected"
oFF.Range.Font.Name = "Arial Bold"
Case Is = "Not Selected"
oFF.Range.Font.Name = "Arial"
Case Else
'Do Nothing
End Select
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Kwanjangnim wrote:
Happy New Year everyone

i have a good knowledge of word, but know nothing about using macros.
I have created a form with dropdown fields with 2 or more choices, i
would like to attach a macro (conditional format) to each choice of
selection (within the DD field) that will change current font
attributes according to the users choice. can anyone help?

example typical choices: DD field contains
1. Not selected (Arial)
2. SELECTED (Arial Black)

thanking you in advance for your help with this problem
colin