#HOW TO EDIT STYLE PANE IN WORD HOW TO#
For instance, he wonders how to add his own styles to it or rearrange the order in which styles appear in the gallery.Ĭhanging what appears in style gallery is easier than it first appears. He's wondering, though, how to change what is shown in Word's style gallery. When you restart word then the styles pane will be displayed.Robert knows how to create and modify styles. This will create a module with a default name typically Module 1Ĩ. Private Sub App_WindowActivate(ByVal Doc As Document, ByVal Wn As Window)ĥ. Private Sub App_NewDocument(ByVal Doc As Document) Private Sub App_DocumentOpen(ByVal Doc As Document)Īpp.TaskPanes(wdTaskPaneFormatting).Visible = True Public WithEvents App As Word.Application Copy the following into the Class module window: If the properties window is not visible then click View > Properties Window.Ĥ. Rename the module to clsAppEvent in the Properties window. In the Project pane select Normal and expand itģ. From a blank document ALT + F11 to display the VBA Project window.Ģ. They could be placed in an add-in template instead if you don’t want to change the Normal template.ġ.
#HOW TO EDIT STYLE PANE IN WORD CODE#
These instructions are for placing the code in the Normal Template. To cover all three you will need to program in VBA as follows. What you want is to display the Styles pane when Word is initially loaded, when an existing document is loaded or when the user creates a new document. (I have a high-resolution monitor, so I normally set my zoom to somewhere between 150% and 200%.) You could also add more commands to the macro to have it adjust other display features, such as what zoom factor you commonly use. You could, if desired, change the macro to have the name AutoOpen, and then it would be run every time you start Word. Note that this macro (DispSetup) must be executed every time you want to display and position the two panes. Setting the position of the object to msoBarRight places it exactly where it should be docked.
CommandBars("Styles") object comes into play. Turning it on, however, is only half of the task-Anthony also wanted it docked at the right side of the document. TaskPanes(wdTaskPaneFormatting) property is the one that controls whether the Styles task pane is visible or not. CommandBars("Styles").Position = msoBarRight TaskPanes(wdTaskPaneFormatting).Visible = True Instead, you'll need to use a macro to display and position it. Anthony wonders if there is any way to have both of these panes open, docked, and available by default each time a document is opened.Īs Anthony has figured out, there is no way to display the Styles task pane, by default. Whenever he starts Word or opens a document, the Navigation pane remains where he wants it, but the Styles pane needs to be manually displayed. He's had no luck, though, figuring out a way to make sure the Styles pane remains open.
Currently, the Navigation pane automatically opens and docks at the left side of the screen by default, which is great. It would be great if he could set the Styles pane to remain open and docked by default. Anthony regularly works with client's Word files that contain many styles, and each set of styles is different from client to client.