I am trying to spell check a document with many form fields. In a macro I need to "select" all of the form fields at once and then complete the spell check. I am able to select formfields one at a time and loop through them all, but the user has to press the NO key to move between each form field. This is the code I am currenty using. I would like to find a way to skip the looping routine and select all of the form fields, without selecting any of the non form field text. ie. not using SELECTION.WHOLESTORY.<br>
<br>
Here is the code I am currently using.<br>
<br>
Sub FormsSpellCheck()<br>
' If document is protected, Unprotect it.<br>
If ActiveDocument.ProtectionType <> wdNoProtection Then<br>
ActiveDocument.Unprotect Password:=""<br>
End If<br>
<br>
Dim aStory As Range<br>
Dim aField As FormField<br>
For Each aStory In ActiveDocument.StoryRanges<br>
For Each aField In aStory.FormFields<br>
aField.Select<br>
<br>
' Set the language for the document and spell check selection.<br>
Selection.Select<br>
Selection.LanguageID = wdEnglishUS<br>
' Perform Spelling/Grammar check.<br>
If Options.CheckGrammarWithSpelling = True Then<br>
ActiveDocument.CheckGrammar<br>
Else<br>
ActiveDocument.CheckSpelling<br>
End If<br>
Next aField<br>
Next aStory<br>
' ReProtect the document.<br>
If ActiveDocument.ProtectionType = wdNoProtection Then<br>
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True<br>
End If<br>
<br>
End Sub<br>
<br>
<br>
<br>
Here is the code I am currently using.<br>
<br>
Sub FormsSpellCheck()<br>
' If document is protected, Unprotect it.<br>
If ActiveDocument.ProtectionType <> wdNoProtection Then<br>
ActiveDocument.Unprotect Password:=""<br>
End If<br>
<br>
Dim aStory As Range<br>
Dim aField As FormField<br>
For Each aStory In ActiveDocument.StoryRanges<br>
For Each aField In aStory.FormFields<br>
aField.Select<br>
<br>
' Set the language for the document and spell check selection.<br>
Selection.Select<br>
Selection.LanguageID = wdEnglishUS<br>
' Perform Spelling/Grammar check.<br>
If Options.CheckGrammarWithSpelling = True Then<br>
ActiveDocument.CheckGrammar<br>
Else<br>
ActiveDocument.CheckSpelling<br>
End If<br>
Next aField<br>
Next aStory<br>
' ReProtect the document.<br>
If ActiveDocument.ProtectionType = wdNoProtection Then<br>
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True<br>
End If<br>
<br>
End Sub<br>
<br>
<br>