View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Spell check for password protected forms

On Thu, 12 Jun 2008 19:35:00 -0700, Claudine
wrote:

As password protection is essential for my form, can someone please tell me
exactly where I insert Graham Mayor's extra code quoted at the end of this
post?

Thanks to Graham's sample code, I have got the spell check macro working but
only without the password. Please assume I know nothing about visual basic -
I have not used it before and only made macros previously via recording, thus
avoiding inexplicable codes.

Many thanks for your advice. The users of my form will greatly appreciate
spell checking. Graham's extra code (but no advice on placement) is as
follows:

oDoc.Unprotect Password:="Password"


And:

oDoc.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, _
Password:="Password"


I assume that somewhere in your macro, probably near the beginning, there is a
statement

oDoc.Unprotect

If you're using the macro from the article
http://www.word.mvps.org/FAQs/Macros...ProtectDoc.htm, that statement
is just after the comments

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

You need to change that line to

oDoc.Unprotect Password:="Password"

Similarly, somewhere near the end of the macro will be a statement

oDoc.Protect Type:=wdAllowOnlyFormFields, NoReset:=True

In the article's macro, that's just after the comment

'Re-protect the document

You must replace that with the two lines

oDoc.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, _
Password:="Password"

Of course, replace the word in quotes with the actual password for the form.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.