Hide Protection TaskPane using ToolsProtect macro

S

SatishP

Hi All,
I protect my word document programmatically. Later if I try to edit the
document by trying to delete some content or add some content, the protection
task pane appears and shows a 'Stop Protection' button in it. However we do
not want to give our users the chance to unprotect the document as we protect
the document when there is authorization issue.

I want to disable this auto-appearance of the Protection Task Pane when user
tries to edit a protected document. I read that if we override the
ToolsProtect() macro, this is possible. But it doesn't work in my case. I
overrode the macro as follows:

Sub ToolsProtect()
MsgBox "Document is Read-Only"
End Sub

But the task pane pops out as soon as the user tries to edit. Is this no
more supported in Word 2007?
 
G

Graham Mayor

Given that you cannot force users to run macros (that would be an open door
to the virus writers) and that the type of protection you are using is weak
and easily circumvented, you are deluding yourself if you think you can
prevent experienced Word users from editing a document protected in this
way. It is child's play to do so.

Any document that you allow someone to see can be edited. If the documents
are for viewing and printing only, at least make it a tad more difficult to
edit the document, by outputting to PDF - preferably having first output to
a true graphics format as an interim stage so that it cannot readily be
turned back into a Word document. It will not prevent the document from
being edited, but it will make it inconvenient to do so.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

spunkymuffmonkey

Could you not protect the document with a password so even if users can see
the stop protection option, they cannot unprotect?

If you're protecting programmatically then the code would be (example)

ActiveDocument.Protect wdAllowOnlyReading, Password:="Pa55word"
 
G

Graham Mayor

Have you tried that? What's to stop a user saving the document with a
different name - without the password?

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

SatishP

Yes, the password-based protection is a fall-back option for us.
But we would prefer not to show our users the task pane but display a
message indicating that the document is protected whenever they try to edit a
protected document.
I have seen examples of this working in Word 2003 for sure. So I guess from
Word 2007 this is no longer the case and we'll have to live with the task
pane.
 
S

SatishP

Hi,
Apologies for not replying earlier (I do not see your message in the
discussions here; I use Microsoft Web-based newsgroup reader to post).

Our effort is to discourage users from editing protected documents. We are
aware that we cannot absolutely prevent him/her from making changes. Also the
Word document in our case will be embedded inside an external application
using OLE.

We don't expect the user will circumvent this protection and modify the
document. Once he/she sees the message that the document is read-only, he/she
would most likely abort the task and try to get hold of the editable version
(part of the external app). It's like we have two modes of viewing the
document; editable and read-only. When in Read-Only mode, we want to show
this message when the user tries editing and the user will shift to the
'Editable' mode (pretty easy to do in the external app).
Hope I was clear enough.
 
G

Graham Mayor

OK From the SaveAs dialog > Tools > General Options check the read only
check box and apply a password to the Password To Modify only dialog and
click OK then save the document.

When users open the document they will be required to enter that password,
which they won't have, or choose read only. They will not be able to save
any changes to the document and they will already be aware that the document
is read only. The task pane should not open.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

SatishP

Hi,
Thanks for the tip. I didn't know this option existed.
Once again, thanks.

-SatishP
 

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