Help with Protected document spell checking

Joined
Oct 12, 2006
Messages
1
Reaction score
0
I have created a macro to perform spell checking on a protected document. Below is the code I found and it was working with no probelms , but once I copied this code to another form, I see it cycle through the form fields but it just skips mispelled words, or it will work on some fields and other it wont. Is there something I am missing. Like I said this works fine on one form when I copied it to other forms that does the exact same thing it doesnt work. Any help is greatly appreciated




Sub SpellFields()
Dim objField As Field
ActiveDocument.Unprotect Password:="xxxxx"
ActiveDocument.Range.LanguageID = wdEnglishUS
For Each objField In ActiveDocument.Fields
objField.Result.CheckSpelling
Next
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, noreset:=True
End Sub
 
Back
Top