Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2005

Tip: Looking for answers? Try searching our database.

How to perform a "pseudo" ActiveDocument.protect

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
barnettj68@yahoo.com - 28 Sep 2005 18:31 GMT
I have a need to prevent changes from being made to an ActiveDocument.
The limitation is I'm trying to "band-aid" a 3rd party application.  It
breaks if the ActiveDocument is protected.  I know that I can capture
the user moving the mouse (i.e making a selection) via
WindowSelectionChange event.  How can I then prevent the user from
making any changes or additions (pseudo-protect)?  Is there a built-in
macro(s) that I could override?
Dawn Crosier - 29 Sep 2005 17:46 GMT
When you load the ActiveDocument, you can protect it by adding
the following code to the startup of your document.

Sub proToggleFormLock()

'Toggle the Protection on and off

If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then

ActiveDocument.Unprotect Password:="myPassword"

Else

ActiveDocument.Protect Password:="myPassword", NoReset:=True,
Type:= _

wdAllowOnlyFormFields

End If

End Sub

I am not aware of any built-in macro's which would help you with
what you want to do other than to increase the security level to
High or Very High depending on the version of Word you are
running.

Signature

Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"

This message is posted to a newsgroup. Please post replies and
questions to the newsgroup so that others can learn as well.

I have a need to prevent changes from being made to an
ActiveDocument.
The limitation is I'm trying to "band-aid" a 3rd party
application.  It
breaks if the ActiveDocument is protected.  I know that I can
capture
the user moving the mouse (i.e making a selection) via
WindowSelectionChange event.  How can I then prevent the user
from
making any changes or additions (pseudo-protect)?  Is there a
built-in
macro(s) that I could override?
barnettj68@yahoo.com - 29 Sep 2005 19:01 GMT
Unfortunately the 3rd party's ActiveX control that integrates with Word
fails when the ActiveDocument is protected via ActiveDocument.Protect.
Thus the need to override the ability to edit, delete, or insert text
when the WindowSelectionChange event fires.

> When you load the ActiveDocument, you can protect it by adding
> the following code to the startup of your document.
[quoted text clipped - 43 lines]
> built-in
> macro(s) that I could override?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.