Prevent changes to a document

D

Daniel Pratt

I have a need to prevent changes to a word document through automation.
Using Document.Protect will not work for me unless there is a way to
suppress the dialog/pane that pops open when the user attempts to edit the
document. Basically, I want the functionality of the MS Word Viewer. The
user should be able to highlight, copy, scroll, etc., but not edit.

Supposing that is not possible, is there a way to detect changes to a
document as they happen?

Thanks,
Dan
 
C

Charles Kenyon

If they can read it, they can copy and modify it. All you can do is make it
harder.

A basic protection is protect for forms (with no formfields). This will let
the recipient read it but not copy using select copy, because you can't
select. This is easily defeated, though. Another is to change to pdf format.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
J

Jezebel

Forget it. There's no security you can apply that isn't easily defeatable.
In practice you just create annoyances for the good folk who wouldn't do it
anyway, without creating serious hindrances for those of ill-intent.Apart
from anything else, a user can always retype the document from scratch.

Alternatives: distribute your document as a PDF, with editing security
switched on. (Still defeatable, but harder.) Or keep a master copy of the
document then run 'Compare Versions' afterwards.
 
J

jay

The discussion circles back to the question: "why do you want to
prevent changes?"
I you want to guarantee that users get correct/current information,
perhaps it should be posted as a PDF somewhere users can EASILY go for
the info.
If they always go the 'correct' location, they will get the original
and not someone's revision.

(Why would someone change it? malice? good intentions?)
Depending on your situation/environment, etc. it ay be time for some
document/content/information control and/or management.

If people would want to revise the doc, maybe you can 'invite' them to
submit revisions (suggestions, requests) for review and/or approval.
 
D

Daniel Pratt

Daniel Pratt said:
I have a need to prevent changes to a word document through automation.
Using Document.Protect will not work for me unless there is a way to
suppress the dialog/pane that pops open when the user attempts to edit the
document. Basically, I want the functionality of the MS Word Viewer. The
user should be able to highlight, copy, scroll, etc., but not edit.

Supposing that is not possible, is there a way to detect changes to a
document as they happen?

Thanks,
Dan

Thanks all for the feedback. Perhaps a little more information: These
documents are actually stored in a database and are integrated into a larger
application. I am hosting the documents on a form using the "DSOFramer"
control. The way our application works is that once a user makes a change to
a "record" that record will become "locked" and other users will not be
permitted to change it. I am trying to make the editing of the Word document
consistent with this behavior.

Thanks,
Dan
 
J

Jezebel

You can monitor the document's .Saved property: this changes from TRUE to
FALSE when Word considers that the document has changed. This includes any
editing change, but -- unfortunately for your purposes -- it also includes a
multitude of innocuous events like printing the document (changes the Last
Print Date property) and querying any custom document property (Word bug).

You can also monitor the Undo list: if this contains anything, then the user
must have done something undoable...

But none of these methods is likely to be very satisfactory.
 
J

jay

Can't you, using VBA, disable or reassign menu items and toolboxes?
Since you already maintain the doc in a database, the user can't change
the version in the database without authorization, right?
So, the only issue would be the user trying to save a local copy or
printing a "revised" edition without permission?
You can redirect the "save" adn "save as" comands and go from there...
Jay
 

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