Yes/No checkbox OR drop down

R

rachitm

I have a word document where there are lots of Yes/No drop down boxes.
Is there a way I could make them default to either of the 2 choices on
the click of a command button (or some other way) ?

Thanks.
 
J

Jean-Guy Marcil

(e-mail address removed) was telling us:
(e-mail address removed) nous racontait que :
I have a word document where there are lots of Yes/No drop down
boxes. Is there a way I could make them default to either of the 2
choices on the click of a command button (or some other way) ?


Try this (Untested):

'_______________________________________
Dim aDoc As Document
Dim ffToReset As FormFields
Dim i As Long

Set aDoc = ActiveDocument
With aDoc.Range
Set ffToReset = .FormFields
If ffToReset.Count > 0 Then
For i = 1 To ffToReset.Count
Select Case ffToReset(i).Type
Case wdFieldFormDropDown
'Change to 2 if you want the second value
ffToReset(i).DropDown.Value = 1
End Select
Next
End If
End With
'_______________________________________

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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