This site will look better if you upgrade to a browser that supports web standards.
Word comes standard with a Standard toolbar.
This toolbar contains a broad spectrum of commonly used commands, but I've never known anyone for whom the controls are optimum. Some people modify their Standard toolbar to suit. This has the advantage of being simple, but the Standard toolbar is stored in the Normal template. Since that template is fairly susceptible to corruption, that makes the modified toolbar is lost if the Normal template has to be deleted. Therefore I create a replacement "My Standard" toolbar in a global template (also known as an add-in):
I prefer to create the "My Standard" toolbar in code. This ensures that the toolbar is created fresh each time Word is opened or the macro is run. Any customizations that are done within each session aren't saved.
The first section deletes any other "My Standard" toolbar:
Public Sub StandardBar_Setup() On Error Resume Next CommandBars("My Standard").Delete On Error GoTo 0
The next section creates the toolbar, and places it in the top dock. Setting the .Visible property to False speeds the creation of the toolbar. Setting the Temporary property to True ensures that the toolbar is destroyed when Word closes, rather than being stored in the Normal template.
With CommandBars.Add( _ Name:="My Standard", _ Position:=msoBarTop, _ Menubar:=False, _ temporary:=True) .Visible = False .Enabled = True .Height = 28 .Width = 720 .RowIndex = msoBarRowFirst
Now the controls are added.
With .Controls .Add Type:=msoControlButton, ID:=2188 'Mail Recipient .Add(Type:=msoControlButton, ID:=247).BeginGroup = True 'Page Setup .Add Type:=msoControlButton, ID:=2521 'Print .Add Type:=msoControlButton, ID:=109 'Print Preview .Add Type:=msoControlSplitDropdown, ID:=128 'Undo .Add Type:=msoControlSplitDropdown, ID:=129 'Redo .Add Type:=msoControlButton, ID:=108 'Format Painter .Add Type:=msoControlButton, ID:=125 'Date .Add Type:=msoControlButton, ID:=126 'Time .Add Type:=msoControlButton, ID:=288 'View Field Codes .Add Type:=msoControlButton, ID:=308 'Symbol .Add Type:=msoControlButton, ID:=916 'Tables & Borders Toolbar .Add Type:=msoControlButton, ID:=204 'Drawing Toolbar .Add Type:=msoControlButton, ID:=8219 'Dictionary .Add Type:=msoControlButton, ID:=3485 'AutoText .Add(Type:=msoControlButton, ID:=758).FaceId = 777 'Bookmark .Add Type:=msoControlButton, ID:=119 'Show All .Add Type:=msoControlButton, ID:=6 'Fit to Window .Add Type:=msoControlButton, ID:=5 'One Page .Add Type:=msoControlComboBox, ID:=1733 'Zoom .Add Type:=msoControlButton, ID:=984 'Search Word Help End With
Finally, the toolbar is made visible, locked in place and the built-in toolbar hidden and disabled:
.Visible = True .Protection = msoBarNoMove End With With CommandBars("Standard") .Visible = False .Enabled = True End With End Sub
This page last updated on
© Copyright 2001 - 2004 McGimpsey and Associates. Except where noted, all code on this site may be distributed under the Gnu GPL. Acknowledgement is appreciated.
Updated? Check Mactopia Downloads for the latest updates.
Figure out which v.X update you have.