Here is a link to an almost full listing of
Word commands,
WARNING!!!! Do not, repeat NOT, open this file unless you already have the VBE open.
ALL Word commands are disabled in this file (override.dot)...including being able to close it. AND the command to open the VBE. So if it is not already open....you can't open it, which means you can't alter the closing command...
You have to comment out the FileClose sub in the VBE to be able to close it.
It is interesting going through the hundreds of procedures. The names of the commands are mostly sane, but some are odd.
Also note that override.dot simply rewrites the commands as messageboxes saying the name of the command. They do NOT show what the real command syntax is. You are on your own to do that.
For example:
Sub ViewVBCode() is the command
name to open the VBE.
But the actual
instruction is:
ShowVisualBasicEditor = True
So in override.dot there is the sub:
Code:
Sub ViewVBCode()
Msgbox "ViewVBCode"
End Sub
So if you do Alt-F11, or Tools > Macros > Visual Basic Editor, you get the messagebox (and no VBE). But you need to know what the REAL instruction is, if you want to use it in any practical way. For example:
Code:
Sub Document_Open()
If ShowVisualBasicEditor = True Then
ShowVisualBasicEditor = False
End Sub
Sub ViewVBCode()
If Environs("username") <> "gerry" Then
Msgbox "Access to the Visual Basic Editor " & _
"is denied."
Else
ShowVisualBasicEditor = True
End If
End Sub
The above closes the VBE (if open) when the document is opened. Then, unless the login name is "gerry", the VBE can not be opened.
Please note that NONE of the override tricks have any serious level of security, and should never be used as such. It would not take much to get around them if you have moderate knowledge of VBA and Word.
The major use of looking at the file (at the link above) is getting a deeper understanding of the Word document/object model. It is a handy companion to wandering through the Object Browser.
faq219-2884
Gerry
My paintings and sculpture