BlueHorizon
Instructor
Hi all,
I used the following macro in Word 2000 to unlock (the little lock on the Forms toolbar), then unprotect (using a password), then spell check a word document with form fields, then relock (the little lock on the Forms toolbar).
What it doesn't do is re-protect using the original password. How can I make that happen?
Sub FormsSpellCheck()
' If document is protected, Unprotect it.
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect Password:="password"
End If
' Set the language for the document.
Selection.WholeStory
Selection.LanguageID = wdEnglishUS
Selection.NoProofing = False
' Perform Spelling/Grammar check.
If Options.CheckGrammarWithSpelling = True Then
ActiveDocument.CheckGrammar
Else
ActiveDocument.CheckSpelling
End If
' ReProtect the document.
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True
End If
End Sub
Any help is gratefully accepted!! Thanks in advance,
Kathy
Best,
Blue Horizon![[2thumbsup] [2thumbsup] [2thumbsup]](/data/assets/smilies/2thumbsup.gif)
I used the following macro in Word 2000 to unlock (the little lock on the Forms toolbar), then unprotect (using a password), then spell check a word document with form fields, then relock (the little lock on the Forms toolbar).
What it doesn't do is re-protect using the original password. How can I make that happen?
Sub FormsSpellCheck()
' If document is protected, Unprotect it.
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect Password:="password"
End If
' Set the language for the document.
Selection.WholeStory
Selection.LanguageID = wdEnglishUS
Selection.NoProofing = False
' Perform Spelling/Grammar check.
If Options.CheckGrammarWithSpelling = True Then
ActiveDocument.CheckGrammar
Else
ActiveDocument.CheckSpelling
End If
' ReProtect the document.
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True
End If
End Sub
Any help is gratefully accepted!! Thanks in advance,
Kathy
Best,
Blue Horizon
![[2thumbsup] [2thumbsup] [2thumbsup]](/data/assets/smilies/2thumbsup.gif)