Spellcheck in protected forms

L

Leslie

I copied the code into a macro from
http://word.mvps.org/FAQs/MacrosVBA/SpellcheckProtectDoc.htm. I ran the
macro and got the following run-time error: '4605' The Type method or
property is not available because the document is a protected document.

In item 2 on the SpellcheckProtectDoc.htm, it says to put the password in
the code. Would this be causing the error, and if so, where exactly in the
code do these two strings belong?
(oDoc.Unprotect Password:="Password")
and
(oDoc.Protect Type:wdAllowOnlyFormFields, NoReset:=True, Password:="Password"

Thank you!!
 
L

Leslie

Nevermind - I found it. I entered both lines of code after the following
comments:

'If we've got this far, it's protected for forms
'Now unprotect the document
'************************

Now the spell check works, no errors. Hopefully it'll work the same on
other pc's. :)
 

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