Protecting a word document

C

cunnus88

I've created a word document which has been linked to its ow
independent template and all connections to normal.dot have bee
severed.

What I want to do is this. If a user opens this document and choose
not to include the macros, then the user shouldn't be able to see th
contents of the document or (even better) open it at all.

I tried doing some tricks with the Document_Open() procedure but to n
avail. It seems that this procedure is triggered after the user ha
chosen to include the macro.

I tried password protecting the document and then wondered whethe
there was a way to pass that password within Document_Open() but i
seems the password request happens before that.

So is there any way to prevent a user from viewing the contents of
document at all if he chooses not to include the macros
 
A

Anne Troy

Not like we can do with Excel by hiding sheets that are unhidden when macros
are enabled. I think the best you could offer is a huge autotext entry that
gets used on the Document_Open would be about it... I'm anxious to see the
responses, too.
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com



cunnus88 said:
I've created a word document which has been linked to its own
independent template and all connections to normal.dot have been
severed.

What I want to do is this. If a user opens this document and chooses
not to include the macros, then the user shouldn't be able to see the
contents of the document or (even better) open it at all.

I tried doing some tricks with the Document_Open() procedure but to no
avail. It seems that this procedure is triggered after the user has
chosen to include the macro.

I tried password protecting the document and then wondered whether
there was a way to pass that password within Document_Open() but it
seems the password request happens before that.

So is there any way to prevent a user from viewing the contents of a
document at all if he chooses not to include the macros?
http://www.officehelp.in/archive/index.php |
http://www.officehelp.in/index/index.php
 
C

Cindy M -WordMVP-

Hi Cunnus88,

I agree with Anne on this one. If the macro isn't enabled, then there's
no way the macro can take any action. So the macro would have to be
responsible for creating the content, whether as AutoText, loading it
from another, password-protected file, or creating it from scratch.
I've created a word document which has been linked to its own
independent template and all connections to normal.dot have been
severed.

What I want to do is this. If a user opens this document and chooses
not to include the macros, then the user shouldn't be able to see the
contents of the document or (even better) open it at all.

I tried doing some tricks with the Document_Open() procedure but to no
avail. It seems that this procedure is triggered after the user has
chosen to include the macro.

I tried password protecting the document and then wondered whether
there was a way to pass that password within Document_Open() but it
seems the password request happens before that.

So is there any way to prevent a user from viewing the contents of a
document at all if he chooses not to include the macros?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
C

Chuck

I've got my stupid goggles on today so I'm not quite visualising what you
mean by "if a users opens this document and chooses not to include the
macros", but leaving that aside it seems to me you can control whether the
document opens by opening it from an external macro called from a toolbar or
menu or userform or whatever. Present the user with a "do you agree" type
message: if they say no, don't open, if they say yes, open. Your
toolbar/menu/userform can be in the independent template you mentioned the
document is linked to (for instance installing that template as an add-in).

HTH
 
A

Anne Troy

Ah... therein lies the problem, Chuck. The 2nd document still has to be
distributed (at least if you're outside a company network), and there's
virtually no way to protect the second document.
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com


Chuck said:
I've got my stupid goggles on today so I'm not quite visualising what you
mean by "if a users opens this document and chooses not to include the
macros", but leaving that aside it seems to me you can control whether the
document opens by opening it from an external macro called from a toolbar or
menu or userform or whatever. Present the user with a "do you agree" type
message: if they say no, don't open, if they say yes, open. Your
toolbar/menu/userform can be in the independent template you mentioned the
document is linked to (for instance installing that template as an add-in).

HTH
http://www.officehelp.in/archive/index.php |
http://www.officehelp.in/index/index.php
 
K

Klaus Linke

And if you'd distribute the document (password or even IRM protected) and a VB program that opens it with macros enabled?
You'd need to disassemble the VB program to get at the password.

The recipient would need to trust you blindly, though.

Greetings,
Klaus
 
H

Helmut Weber

Hi Klaus,
....
at this early hour,
....
got a new newsreader?

In Agent forte there are no automatic linebreaks anymore
in your postings. Makes them very hard to read.


Greetings from Bavaria, Germany

Helmut Weber, MVP, WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
C

Chuck

Ok, so the problem is with distributing the *template* that the document is
based on? If by "linked" the OP meant that the document itself contains
macros that reference the separate template, the OP could instead move the
macros to the template and call them from there.

Sorry for being dim but I don't understand what the real world problem is.
If the point is to distribute a document that is "linked" (based on?) a
separate template to users who may not be able to or choose not to run macros
from untrusted sources then it seems to me the solution would be to:

1. make sure the document contains no code and is password protected.
2. protect the code in the template so that it can't be viewed/edited
3. include a macro in the template that opens the document with a hard coded
password - the password is hidden by the protection on the code
4. if the user chooses not to enable macros, they can't open the document
because they don't have the password
5. if the user enables macros and opens the document, the password is
removed via the code so there's no protection issue on the document anymore
but the code is still protected so the password is as well

That solution separates the contents of the document from the template so
that even if the user opens the template with macros disabled they can't see
the contents the OP wants to hide.

Unless the OP password protects the document, users can still view the
contents with any number of viewers. Granted, password protection is fairly
easily cracked so the above workaround isn't bulletproof but hopefully it
would get the job done?

Then again, maybe I've still got stupid goggles on.
 
C

Charles Kenyon

Yes, sort of. You need to put the contents of the word document in a place
that is only accessible to macros. You could
Have your AutoOpen (or AutoNew) macro create your document. If macros don't
run, there is nothing there to look at. Of course once it has been created /
opened with macros open, nothing prevents it being saved and reopened.
--
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.
 

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