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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command bars in Word 2007

Status
Not open for further replies.

BrianWen

Programmer
Jun 8, 2009
102
DK
I have inherited the maintenance and devolopment of a template system in my organization. It was developed many years ago (maybe for Word 2000) and consists of a single dot-file in the startup-folder in the Microsoft Office folder. When that file is loaded as an add-in (happens automatically since it's in Startup folder) it gives the users and extra button under the Add-ins ribbon in Word 2007. That opens a form displaying dot-files from certain folders, that can be launched from there.

I have two problems. First one is that I cannot figure out how that startup dot-file adds the button under Add-ins (It's in a box box called Menu Commands, not Custom Toolbars). I've looked through all the VBA code (there isn't much) and it's not declared there. Where would one declare such a button. It certainly is in that dot-file, because if I remove it, the buton disappears too.

Next problem is with all of those other dot files the main dot loads. They load additional code from a dll file, but essentially they are only different in layout. When creating a new document from one of those, a setup form is shown on screen and the users sets up the document (using fields and all). Whenever the user opens a document created with one of those (no matter if it's new or saved and reopened) it adds another button under Add-ins (Under Custom Toolbar) that opens the Setup form again.
The code to call that is:

CommandBars("Template Setup").Visible = True

It is placed in every dot file in Private Sub Document_Open() under ThisDocument.

Problem is it works for me, but for many other users it doesn't show. I cannot find anywhere where the Custom Toolbar Template Setup is declared in any way.

Please note the code is written for an old Word. It worked perfectly in Word 2003, but Word 2007 isn't behaving perfectly for most of the users (if not all but me).

Please give me some advice on what and where to check for declarations of command bars or perhaps an idea why it won't show.
 
Is there any form of security setting (or other setting/option) that could prevent a toolbar from being shown (or loaded(initialized).

CommandBars("Template Setup").Visible = True

Is placed in Document_open()

It shows every time on my Office, but not on others'. Code is not wrong, so perhaps it's some sort of setting??
 
In Office 2007 add-ins can get disabled if they crash - you can manage these by going into Word options, Add-Ins and selecting 'Disabled Items' in the 'Manage' drop-down.

Also you say that "(those other dot files the main dot loads) load additional code from a dll file". Do all the users have those other .dot files and the accompanying DLL?

Nelviticus
 
Thanks for the answer...

I will check the disabled items list, but for all users, the first dot file loads just fine, so I doubt I will find anything (I hope though).

Regarding your question, yes everyone has all files and in correct place. They are automatically placed there when logging on the domain. I someone deletes or changes them, they get restored from a server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top