add spellcheck in a locked form

G

Guest

I create several of forms in word for our staff. Is there a way that you can
spell check in a field that is in a locked form. The spell check under tools
is not availabe when the form is locked.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...cd212b&dg=microsoft.public.word.docmanagement
 
G

Guest

Hi,

Try this - it seems to work for me in Word 2003.

You need to create a new macro that unprotects the sheet to allow for
spellcheck only:

Sub Spell_Check()
Unprotect Password:="yourpassword"
CheckSpelling SpellLang:=1033
Protect Password:="yourpassword"
End Sub

Hope it helps.
Billie.
 
J

Jay Freedman

Um, I don't know how it works for you, because all it does for me is throw
compiler errors. That's because you left out the "ActiveDocument." qualifier
from the beginning of each line (or "With ActiveDocument" at the start and
"End With" at the end, and you still need the dots before the method names).
And when you correct that, the only part of the form it spell-checks is the
text that isn't in the form fields, which is pretty useless.

Most of the complications in the macro on the MVP site are there because
they're needed. If you never open the form in Word 97 you can simplify it a
bit; and if the form document has only one section you can simplify some
more, but nothing like this three-line macro is going to do the job.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
C

CJ

I am having the same problem with a document using Word 2003. I have tried
following those directions in the link, but I get an error. It errors on the
line that reads..... "Call CheckProtectedSection(oSection)"

Any suggestions?

Second question, how can you put this into the template for spellchecking in
lieu of having a to build a macro and having it on the toolbar?

Thank you,

CJ
 
G

Graham Mayor

If this is a simple form without separate sections in which you simply want
to check the field entries, you can simplify the code to the following -
adding your password between the quotes at the two locations indicated.

The error you are experiencing suggests you have not added the
CheckProtectedSection routine listed on the quoted page.

See http://www.gmayor.com/installing_macro.htm

If you want to spell check a form, then the user of the form must have
access to the macro, which can be saved in the form template the user's
normal.dot template, or the document itself, but if saved in the document
there are macro security implications which could render it unavailable to
many users. You can either run it from a toolbar button or on exit from a
field the user will tab out of.

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

CJ

Thank you very much for that. I was able to build the macro and apply it to
my toolbar and it is working well.

Now my next challenge is that I would like to insert it into the document .
I don't want to have to build macros on 70 company computers, so I would like
to have it in the document, ideally since this is spellcheck, I would like to
have it initiallize upon selecting the "print" button. Is this possible? If
so, can you walk me through it?

Thank you very much!
 
G

Graham Mayor

Documents with macros have security implications that will cause users to
fret and make them unavailable. If you are distributing this form to fellow
workers, then save it as a template and distribute the template. Users can
then create new forms from the template.

Move the macro from normal.dot to the template using the organizer. If you
want the macro to also print the document, then add the line

ActiveDocument.PrintOut

immediately before End Sub

If you want it to run from the print button on the standard toolbar then
rename the macro

Sub FilePrintDefault()

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

CJ

I'm using a template. I tried to move the macro as you suggested from
normal.dot to my template using the organizer, however "move" is not an
option, so I tried "copy" and it said "the project item cannot be copied". I
guess I don't know how I move the macro to have it embedded into the
template. Can you try again, maybe with a few more details? :)

Thank you.
 

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