Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

macro in toolbar for all users in Word

Status
Not open for further replies.

itfellow

MIS
Jan 6, 2004
130
US
Hi all,

I have some code written that goes through and blanks out all of the fields in a Word form. I originally had it assigned to a button in the doc, but I didn't want the button printing out, so I decided to put it in the toolbar. I can do this just fine, but I cannot get the toolbar button to be present when any other user opens the doc, even though I saved the code to the project (rather than to normal.dot). Can anyone point me in the right direction on how to make this button visible to all users?
 
Does everyone have macro settings set to low or medium? If this is set to High, then no macros can run in the document when the users open it.

Cheers,
Dave

Probably the only Test Analyst Manager on Tek-Tips...therefore whatever it was that went wrong, I'm to blame...

animadverto vos in Abyssus!

Take a look at Forum1393!
 
Yes, the users have the security set to "medium", which means they get asked each time if they want to enable macros. On the two systems I've been using to test, I have made sure that macros are enabled.
 
Hi itfellow,

You say you have the code in the document but what about the toolbar customization - where have you saved that? On the Tools > Customize Dialog there is a dropdown at the bottom to say where you want to save changes.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
OK, I think I've figured out the first part of it: what I was doing originally was trying to save the macro into an existing toolbar, like "standard". Even though I was telling Word to save the change to the "standard" toolbar in myproject.doc instead of normal.dot, Word was still defaulting the "standard" toolbar to the normal.dot version rather than the "myproject.doc" version. So, I created a whole new toolbar, called "MYTOOLS" and stuck the macro in there. Now, when a user opens the doc on their system, the "MYTOOLS" toolbar shows up as an available toolbar (although it does not appear to be checked for viewing by default). So, if the user goes to View->Toolbars and checks "MYTOOLS", he can see my button. I'd like to be able to get that checked by default, but at least I'm getting closer.

Oh, and if I can figure out how to change the name of the macro button from "project.mydocument.mymacro" to something else I will be much happier also.
 
Hi itfellow,

You ought to be able to make changes to the standard toolbar and save them in your document and have them appear for other users.

As for your own toolbar, I have to say I have found Word 2003 to be a little inconsistent in how it displays (or doesn't) custom toolbars in documents, but you can control it all in code.

As you already have code in your document there are no (extra) security options to worry about so why not create (or make visible) your own toolbar (or icon) in the document open event?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Right click the toolbar, select Customize, right click
"project.mydocument.mymacro", highlight the Name, type in whatever you want. Close with OK.

As for your toolbar, you could have it load up with the Document_Open event.

Gerry
See my Paintings and Sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top