Spellcheck in protected forms.

G

Guest

I have read and attempted to follow the macro creation option for spell
checking. I have been unsuccessful.

I am far from an intermediate user of MS Word 2003. I would say far below
that. However, I need to spellcheck a form that I created while it is still
protected. 20 other people need it also. Unprotecting and spell checking
isn't a good option.

Can anybody help me do this or is the way that others have shown how to do
it the only way? And should I kind of give up, not really knowing how to
create macros correctly? Or so it seems.

Any help is appreciated
 
G

Guest

thank you.

I was afraid that was what I would get. that's the stuff that is kicking my
butt. I'll keep trying.
 
G

garfield-n-odie [MVP]

Not sure why you think it's kicking butt. The macro is already written.
All you have to do is copy and paste it.
 
G

Guest

I have copied and pasted. Unfortunately it does not take for some reason. I
get an error every time. I am going to keep trying.

It says on the top to delete the stuff in the window that it defaults with
prior to pasting it in. Do I delete everything or am I doing that wrong?
 
G

Graham Mayor

What error do you get?
Does your form have a password? If it does then you need to insert the
correct password between the quotes.
I have assumed that you want spell checking in US English.

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 = wdEnglishUS
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

My web site www.gmayor.com

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

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