Excuse Peter, but you state "that will not disable Alt-F11".
Hmmm, I suspect you did not actually try it. The code DOES disable Alt-F11,
it also disables Tools > Macro > Visual Basic Editor.
Sub ViewVBCode()
Msgbox "Sorry, you can't do that."
End Sub
will permanently disable opening the VBE. Alt-F11 will just give the
message. Tools > Macro > Visual Basic Editor will give the message. I would
say that effectively disables getting at code. Or perhaps there is a
different meaning to disable that I do not understand. Which is very
possible. However, the actual Word Command to open the VBE is...wait for
it...ViewVBCode.
Yes, if you are very very good, you can hack your way. However if you put
it in the ThisDocument module, I suggest you add a logic loop if you ever
want to see the code again.
> Excuse Peter, but you state "that will not disable Alt-F11".
I did state that, but about password-protecting the project, not about ViewVBCode.
> Hmmm, I suspect you did not actually try it. The code DOES disable Alt-F11,
> it also disables Tools > Macro > Visual Basic Editor.
Hmmm, yes I did actually try it, and my comment was that it's too easy to get around.
> Sub ViewVBCode()
> Msgbox "Sorry, you can't do that."
[quoted text clipped - 6 lines]
> possible. However, the actual Word Command to open the VBE is...wait for
> it...ViewVBCode.
Why so insistent and condescending over such a minor issue?
> Yes, if you are very very good, you can hack your way. However if you put
> it in the ThisDocument module, I suggest you add a logic loop if you ever
> want to see the code again.
(Un)fortunately, I'm not "very very good" when it comes to hacking Word, and I found it trivial to bypass.
Jean-Guy Marcil put it well:
> > Just keep in mind that whatever method you choose, it will easily be
> > bypassed by anyone who wants to and who has access to an Internet search
[quoted text clipped - 5 lines]
> > Setting a password is really no real security.... This is one of the easiest
> > password to crack...
hth,
-Peter