VBS to create a toolbar

F

Francesco Barbieri

Hi all,
it's possible, using a .VBS script, to install a new menu toolbar in a
office application?

thanks
 
P

Philo [MSFT]

Certainly. You could use code something like this:

Set TheWordApp = CreateObject("Word.Application")
Set NewToolbar = TheWordApp.CommandBars.Add("New new Toolbar",
msoBarTop, False, False)
NewToolbar.Enabled = True
NewToolbar.Visible = True
Set NewButton = NewToolbar.Controls.Add
With NewButton
.Caption = "Click to run MacroName"
.OnAction = "MacroName"
.Visible = True
End With

Set NewToolbar = Nothing
Set NewButton = Nothing
TheWordApp.Quit
Set TheWordApp = Nothing

-Philo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top