open document or cancel command macro

P

Petie

I need to write a macro for a word document which allows users to insert an
electronic signature (jpeg file). The problem is this needs to be password
protected. Can anyone suggest how i might add security, or at least if I
have the jpeg copied into a password protected word document, how I may at
least write a error dialogs if they select "Cancel" or input an incorrect
password?
 
J

Jezebel

You can do the password bit by creating a UserForm with a textbox and
OK/Cancel buttons. Set the PasswordChar property of the textbox ("*" is the
convention); use the OK button code to validate the password. You can load
an encryption library (there's one that comes with Windows, and there are
several free open-source libraries) to hash the signature for secure
validation, so you don't have to secure your VBA code also.

An alternative is to create the signature as an AutoText entry in the
template, and password-protect the template itself.

Neither of these methods is particularly secure; but the value of the
security is moot in any case. As soon as you send the document to anyone
you've lost control over the signature graphic. If people can see it, they
can copy it (just as they can scan the signature out of a hard-copy letter).
 
G

Graham Mayor

As Jezebel indicates, there really is no point doing this. Anything you
allow someone to see can be easily reproduced. Adding a password simply adds
complexity to provide only a false sense of security.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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