Another question about spellchecking a protected document

C

chief21

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
do 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
 
C

chief21

Hey Mr. Robbins thanks for the help, it works mostly but the form I am
woking on is on 2 pages so when I tab to a new field on the second page
the spell checking runs then again when the I hit the submit button
which calls the spellchecker subroutine which is how I want it to run
after the user has entered all info into the form fields he hits
submits and the spell checking should be run then. Any advice?
 

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