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!

Howto add a menu bar button in ms word 2003 through vbs

Status
Not open for further replies.

Dosfreak

Technical User
Jan 9, 2007
6
NL
Hello,

my boss asked me to make an option in my logon script so that every user gets and additional button on the default word bar called "internal Documents" under that button should come some documents stored on a share on one of my servers.

after some searching i came to the conclusion the best way would be to do it with macro's, that i can manage.
i also know its stored in normal.dot. however i rather not overwrite normal.dot during logon due to some users have their own adjustments in their normal.dot and by overwriting it would kill their settings.

i would like to have some help getting me started with an vbscript that i can attach to my logon script so that when a user logs on he / she gets the proper script so the desired button appears when they start Word 2003.
 
You are right not to want to touch your users' normal.dot templates.
If you put your menu changes into a global template (or AddIn) and put that into the user's Startup file all should be well.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
maybe i wasn't specific enough or i don't understand what u mean.

i would like to have an vb script option that runs in the domain logon script so that all users get that button added in word.

i allready have the subroutines for the macro's, i just can't get it done to script that i get an extra button next to the "file etc etc help" buttons in Word.
 
First thing to say is that you don't need macros to set up toolbar buttons; you can save them in a template (or document) and they will be automatically there when that template (or document) is open. If they are in a global template (that is a template in Word's Startup directory) which is automatically opened at Word startup then they will always be present. If the buttons you are adding trigger macros, those macros can be saved in the same (global) template.

All you need to do in a domain logon script is check that the latest version of the template is in the startup folder and, if not, to add it. There is a possibility that an individual user may change their startup folder but anybody likely to do that knows enough to (a) make sure that they are not screwing anything up and (b) thwart anything you try to do if they don't like it.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
Let me see if I can state it explicitly.

1. make a Word file with whatever macros, or button do-dahs you want. make it exactly the way you want it to be.

2. save it as a .DOT file - not a .DOC file

3. save it on a server

4. have the script, on logon, copy that file to either:

A) C:\Program Files\Microsoft Office\Office10\Startup
- or something like that. This will load the .DOT file as a global template for all users of that machine.

OR

B) C:\Documents and Settings\username\Application Data\Microsoft\Word\STARTUP

This will load the .DOT file as a global template for that specific user.

Done. Having the script copy the file on every logon is, in the long run, better. It ensures that it is there, and any updates you do on the one .DOT file stored on the server, will be distributed every time. Doing it this way makes no changes to the anyone's normal.dot.

The global template - with your button, or whatever - will be on everyone's Word.

Gerry
My paintings and sculpture
 
C:\Documents and Settings\username\Application Data\Microsoft\Word\STARTUP" will work unless a user plays with the Tools, Options, File Locations, Startup.

Deb
 
Very true. And if you have users that play with File Locations > Startup then you have users that may cause problems.

In fact, unless I actually have multiple users on the same machine (which does occur), I put globals in the Program Files....Startup folder, and make it machine wide.

Gerry
My paintings and sculpture
 
looks like a great solution, only thing is that i can't make it machine wide, because users do not have a "static" workstation.
not all users are supposed to have all documents, so 1 global solution is more difficult.
 
not all users are supposed to have all documents
I do not know what that means. If I may remind you...
Dosfreak said:
so that every user gets and additional button
Every user.

Perhaps if you describe the situation again?

Also,
i can't make it machine wide, because users do not have a "static" workstation
You are asking about login script, so I don't understand. They login and the global template is added, they get the button. If they are not "static" - by which I think you mean they can be on diffferent machines - are you saying that when they logoff you want this button feature to be removed for the next person starting Word? If so, then you need to say so.

You need to describe your situation precisely.


Gerry
My paintings and sculpture
 
I presume you mean that not all users are to have the same menu options under the "internal documents" button that you want to add.

Is the determination of what should be there made at login time or at Word startup or when they select the menu button or when?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
i'll try to clarify a bit.

all users should get the button "internal Documents" when they startup word.

under that button i need "group specified" some documents added, like group test documents test1 test2 test3.

next group managers documents test1 managers1 test3 managers2

next group administration "all documents"

group denied no button - no documents

due to the fact that most users don't have a "static" computer where they work i need it to be managable from an loginscript.
i have a share on one of my servers where i stored all documents.
i can manually add a button and use macro's to call up the documents from the server through an unc path.
its no option to manually do this for over 180 users.

maybe this explanation helps.
i guess this is hard todo and i wonder if it's possible at all.

greetings,
Roger.
 
As I understand it, the Word Startup Folder is part of a user's roaming profile so should exist on the machine the user is logging on to. All you should have to do is to confirm the correct version of the template containing your customization is present and, if not, to create it (if necessary deleting the existing one).

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
Or just always copy the file to the users' Startup folder as part of the login script. Let's see if I follow this.
all users should get the button "internal Documents" when they startup word.

under that button i need "group specified" some documents added, like group test documents test1 test2 test3.

next group managers documents test1 managers1 test3 managers2

next group administration "all documents"

group denied no button - no documents
Even though you state all users get the button "Internal documents"....there is somehow a "group denied" that gets no button - no diocuments. This confuses me.

In any case, you are know talking about an identification logic. NOT all users. You are talking about identifying some users get XXXXXXX menu items, other users get YYYYYYY menu items.

This is a whole different ball game.

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top