• Word 365—Want Fixed Nav + Style Pane sizes

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Word 365—Want Fixed Nav + Style Pane sizes

    Author
    Topic
    #350598

    My standard Word work window has the Navigation & Style panes open on each side of the main content section.

    Word 365 Panes

    Maybe 2 months ago, the panes changed size to larger than before and changing them to my preferred sizes didn’t stick—I tried Shift-click closing and changing the pane sizes in my template.

    Is there some way to make my preferred sizes stick, like they’ve done for years?

    PS I have the following auto macros:

    Sub AutoOpen()
     ActiveWindow.View.Type = wdWebView 'open in Web Layout
     ActiveWindow.View.Zoom.Percentage = 120 'Zoom %
     Application.TaskPanes(wdTaskPaneFormatting).Visible = True 'open Style Pane
     Application.TaskPanes(wdTaskPaneNav).Visible = True 'open Nav Pane
     End Sub
    
    Sub AutoNew()
     ActiveWindow.View.Type = wdWebView 'open in Web Layout
     ActiveWindow.View.Zoom.Percentage = 120 'Zoom %
     Application.TaskPanes(wdTaskPaneFormatting).Visible = True 'open Style Pane
     Application.TaskPanes(wdTaskPaneNav).Visible = True 'open Nav Pane
     End Sub
    

    Lugh.
    ~
    Alienware Aurora R6; Win10 Home x64 1803; Office 365 x32
    i7-7700; GeForce GTX 1060; 16GB DDR4 2400; 1TB SSD, 256GB SSD, 4TB HD

    Viewing 2 reply threads
    Author
    Replies
    • #350852

      Try

      With CommandBars(“Navigation”)
      
      .Visible = True
      
      .Width = 200
      
      .Position = msoBarLeft
      
      End With
      1 user thanked author for this post.
      • #350857

        Please see this blogpost about posting code.

        Use the [ pre ] and [ /pre ] tags to prevent problems with posting.

      • #350888

        Try

        Thanks for your effort Anon, I get…

        Run-time error ‘9’:
        Subscript out of range

        …and no change in either pane’s behavior.

        Clicking Debug highlights the line…

        With CommandBars(“Navigation”) ‘fixed pane width

        I searched on “Subscript out of range”, but got nothing for Word—and only dodgy sites for Excel.

        Fyi I pasted your code into my 2 Auto macros, immediately before End Sub.

        Lugh.
        ~
        Alienware Aurora R6; Win10 Home x64 1803; Office 365 x32
        i7-7700; GeForce GTX 1060; 16GB DDR4 2400; 1TB SSD, 256GB SSD, 4TB HD

        • #443709

          Lugh

          This site converts the straight ” into smart “.

          Try retyping the double quotes either side of Navigation and make sure they become straight.

          1 user thanked author for this post.
    • #467122

      Try retyping the double quotes either side of Navigation and make sure they become straight

      Excellent Anon, that worked, thank you!

      I extrapolated your code, which also worked for the Styles pane on the right side—so here it is for anyone else who wants a setup like mine:

       With CommandBars("Navigation") 'fixed pane width
      .Visible = True
      .Width = 300
      .Position = msoBarLeft
      End With
       With CommandBars("Styles") 'fixed pane width
      .Visible = True
      .Width = 300
      .Position = msoBarRight
      End With
      

      Put the above in the AutoOpen & AutoNew subs of your template if you want this every time—I have mine in the Normal template, since I want this setup for all Word docs.

      I you don’t want it every time, I assume putting the code in its own Sub will give you the option on demand. You might want to attach it to a custom button in the ribbon.
      Alternatively, put it in a custom template, rather than Normal.

      Lugh.
      ~
      Alienware Aurora R6; Win10 Home x64 1803; Office 365 x32
      i7-7700; GeForce GTX 1060; 16GB DDR4 2400; 1TB SSD, 256GB SSD, 4TB HD

      • #494421

        Your welcome. Good to see you got it working.

        If you were going to be putting this into its own sub, I would make it a toggler to show/hide the panes by doing the following. Note that this would be a bad idea in the Auto macros.

        Sub TogglePanes()
        With CommandBars("Navigation") 'fixed pane width
        .Visible = Not .Visible
        .Width = 300
        .Position = msoBarLeft
        End With
         With CommandBars("Styles") 'fixed pane width
        .Visible = Not .Visible
        .Width = 300
        .Position = msoBarRight
        End With
        End Sub
        1 user thanked author for this post.
    • #2039806

      For me, the Styles Pane settings still stick in Word 2019.

      I created an Add-In for the Navigation pane settings that sets and uses a document variable with the following AutoExec macro.

      Sub AutoExec() ' runs when Word Starts
          If ThisDocument.Variables("SetNavPaneWidth").Value = True Then
              Dim iWidth As Integer
              iWidth = ThisDocument.Variables("NavPaneWidth").Value    ' change to suit using dialog
              Application.CommandBars("Navigation").Width = iWidth
      '        Application.CommandBars("Styles").Width = iWidth ' This line is commented out on distribution
          End If
          Application.CommandBars("Navigation").Visible = ThisDocument.Variables("NavState").Value
      End Sub

      The Add-In can be downloaded from my downloads page.

    Viewing 2 reply threads
    Reply To: Word 365—Want Fixed Nav + Style Pane sizes

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: