VBA to remove toolbar and menu choices

K

keith brickey

How can I use VBA to remove toolbar and menu choices for a particular
document?

Thanks,

Keith
 
J

Jonathan West

keith brickey said:
How can I use VBA to remove toolbar and menu choices for a particular
document?

Before attempting to answer in detail, can I ask why you want to do this -
what you are trying to achieve overall?
 
K

keith brickey

I want to eliminate the number, bullet, and indent/outdent buttons and their
associated menu items. the reason is to eliminate dealing with Word numbered
list bugs that seem to be made worse by the use of these features. I have
written some VBA functions that accomplish the same thing without the bugs.

Thanks,

Keith
 
J

Jonathan West

keith brickey said:
I want to eliminate the number, bullet, and indent/outdent buttons and
their
associated menu items. the reason is to eliminate dealing with Word
numbered
list bugs that seem to be made worse by the use of these features. I have
written some VBA functions that accomplish the same thing without the
bugs.

You don't need VBA for this. Create a custom template for your documents.
Then, with the template open, go to Tools Customize. In the Customize dialog
that appears, set it so that changes will be saved in your template rather
than in normal.dot, and then click any button you want to get rid of and
drag it off the toolbar.
 
K

Keith Brickey

I have custom template now that I use to create a new document. The problem
is the the document gets distributed throughout a large community of users,
and many who edit it do not have the template. (Another factor may be that
not all users have the same version of Word.)
I end up with documents containing a lot of "bastardized" styles created by
Word, such as "Stylename CHAR CHAR CHAR CHAR" and these cause confusion
among the users of the document. My idea is, as much as possible, to
programmatically remove styles that are not in the template and strip out as
much as possible, the Word functionality that causes these problems,
replacing that functionality with simple VBA routines known to work
reliably.
 
J

Jonathan West

Keith Brickey said:
I have custom template now that I use to create a new document. The problem
is the the document gets distributed throughout a large community of
users,
and many who edit it do not have the template. (Another factor may be that
not all users have the same version of Word.)
I end up with documents containing a lot of "bastardized" styles created
by
Word, such as "Stylename CHAR CHAR CHAR CHAR" and these cause confusion
among the users of the document. My idea is, as much as possible, to
programmatically remove styles that are not in the template and strip out
as
much as possible, the Word functionality that causes these problems,
replacing that functionality with simple VBA routines known to work
reliably.

Toolbars don't get saved with documents. VBA code *can* be saved in a
document rather than a template, but VBA code in a document simply will not
run if the user is on Word 2000 or later and has macro security set to high,
unless the code is digially signed and the user chooses to accept the
digital signature. If they are working in Word 97 or Word 2000, any edit of
the document will break the digital signature.

Therefore, you need to distribute the template and encourage your users to
use it. This article may give you some ideas in that direction.

Creating Custom Toolbars for Templates
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=262
 
Top