Hidden Form Sections

O

Owen

I have a Word 2003 document with macros that are used to hide sections of the
document dependant on user choices from drop-down fields etc.

When a section is hidden however, as the user tabs through the fields the
cursor still runs through all the fields in the hidden section.

Is their a way to have the fields in the hidden section bypassed?

Thanks
 
G

Graham Mayor

You could make the hidden fields unavailable using the macro that you used
to hide the fields in the first place - something along the lines of

Dim fCount As Long
Dim j As Long
With ActiveDocument
.Unprotect Password:=""
fCount = .FormFields.Count
For j = 1 To fCount
With .FormFields(j)
If .Range.Font.Hidden = True Then
.Enabled = False
Else
.Enabled = True
End If
End With
Next j
.Protect _
Type:=wdAllowOnlyFormFields, _
NoReset:=True, _
Password:=""
End With

Note that this is a broad brush to format all hidden form fields as not
enabled and all visible ones as available. You may need to be more
selective, but this should help point the way.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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