Allow Spellcheck in Protected Docs

D

Don

I would like to find out how I can allow end users to spell check their work
within Form Fields in a protected template or document.
We have forms with legally protected wording and form fields for end users
to insert their information. Instead of having an end user unprotect the
document to enter information and spell check or modify the existing wording,
is there a way that I can create a macro or any other program wording to
allow spell check to work only in form field areas in a protected document?
 
B

Bob Buckland ?:-\)

Hi Don,

See if the information here helps:
http://word.mvps.org/faqs/MacrosVBA/SpellcheckProtectDoc.htm

=========
I would like to find out how I can allow end users to spell check their work
within Form Fields in a protected template or document.
We have forms with legally protected wording and form fields for end users
to insert their information. Instead of having an end user unprotect the
document to enter information and spell check or modify the existing wording,
is there a way that I can create a macro or any other program wording to
allow spell check to work only in form field areas in a protected document? >>
--

Bob Buckland ?:)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*
 
D

Don

Bob, Thank you for the link. I tried this macro and I can't seem to make it
work. I receive errors when debugging the macro. Is there a website that has
more information about this type of macro?

I appreciate your help with this matter.

Don
 
G

Graham Mayor

See http://www.gmayor.com/installing_macro.htm
You should be able to copy the macro below directly to your vba editor
without any problems of premature line wrapping. Add the unlock password (if
any) between the quotes where indicated. If no password, leave the code as
it stands. Run the macro from a toolbar button.

Sub SpellCheckForm()
Dim i As Integer
Dim bProtected As Boolean

'Unprotect the file
If ActiveDocument.ProtectionType <> _
wdNoProtection Then
bProtected = True
ActiveDocument.Unprotect Password:=""

End If

'check each formfield for spelling
For i = 1 To ActiveDocument.FormFields.Count
ActiveDocument.FormFields(i).Select
#If VBA6 Then
Selection.NoProofing = False
#End If
Selection.LanguageID = wdEnglishUK
Selection.Range.CheckSpelling
Next

'Reprotect the document.
If bProtected = True Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True, _
Password:=""
End If
End Sub


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


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

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