2 Ways to Show Navigation Pane in One Specific Word Document Only

In this post, our aim is to provide you with 2 ways to show the navigation pane in one specific Word document only.

For those who use the navigation pane a lot, you must have noticed that it stays for all the documents opened in the future once it’s triggered. Thus, to close it, you would have to manually click the “Close” button. This global feature can be annoying sometime especially when we just want it open for one specific document only.Show "Navigation Pane"

To address this issue, we need the help of Word macro.

Method 1: Macro for Documents Requiring Frequent Change of Name and Path

  1. Firstly, since we need to be able to run macro in a specific document, we have to alter the macro setting first. Click “File” then “Options” to open “Word Options” dialog box. Then click “Trust Center” and “Trust Center Settings” button. Next click “Macro Settings” and select “Enable all macros”. Click “OK” in both boxes.Click "Trust Center"->Click "Trust Center Settins"->Click "Macro Settings"->Select "Enable all macros"->Click "OK" in both boxes
  2. Now press “Alt+ F11” to open VBA editor.
  3. Next click “ThisDocument” under the project of this specific document.
  4. Click “Insert” tab and choose “Module”.Click "ThisDocument"->Click "Insert"->Choose "Module"
  5. Then double click on the module and paste the following codes on the right side space:
Sub AutoOpen()
  ActiveWindow.DocumentMap = True
End Sub
Sub AutoClose()
  ActiveWindow.DocumentMap = False
End Sub
  1. Click “Save” button.Enter Codes->Click "Save"
  2. Now there will be a message box. Click “No”.Click "No"
  3. In the “Save As” window, choose “Word Macro-Enabled Macro” for saving type.
  4. Click “Save”.Choose Saving type->Click "Save"

Now you will have the navigation pane open for just the specific document.

Method 2: Word Macro for Documents with Fixed Name and Path

  1. To start off, Open Word and press “Alt+ F11” to trigger the VBA editor.
  2. In the “Normal” project, click “Insert” and choose “Module”.
  3. Still double click on the module to open the coding area and paste the bellowing macro:
Sub AutoOpen()
  Dim strDocName As String
  Dim strDocpath As String
  Dim nDocName As Integer 
  Dim nDocpath As Integer 
 
  strDocName = "Sample.docx"
  strDocpath = "E:\Temp"
  '  If the two strings sort equally, Returns 0.
  nDocName = StrComp(ActiveDocument.Name, strDocName, vbTextCompare)
  nDocpath = StrComp(ActiveDocument.Path, strDocpath, vbTextCompare)
 
  If nDocName = 0 Then
    If nDocpath = 0 Then
      ActiveWindow.DocumentMap = True
    End If
  Else
    ActiveWindow.DocumentMap = False
  End If
End Sub
  1. Next click “Save”.Paste Macro->Click "Save"

Notes:

  1. In code line “strDocName = “Sample 2.docx””, replace the “Sample 2.docx” with your file name.
  2. In code line “strDocpath = “C:\Users\Public\Documents\New folder””, replace the “C:\Users\Public\Documents\New folder” with the path of the folder where the file is stored. Remember there is no “\” in the end.

Comparison of 2 Methods

Methods Advantages Disadvantages
Method 1: Macro for Documents Requiring Frequent Change of Name and Path The change of document name or path won’t affect the effect. 1.         You have to save the document as .docm type which requires a few more steps.

2.         You have to alter macro settings before save the file as .docm type.

3.         Sometime, the function is not very stable.

Method 2: Word Macro for Documents with Fixed Name and Path 1.         You don’t have to save the document in another type.

2.         It suits those documents with fixed name and path.

If you want to move the document or change its name, you will have to modify the macro.

Address Word Issues

We have encountered with Word errors more or less in our daily use. And the unexpected comes with no sign at all. For this reason, to reduce the effects of docx damage, we encourage you to hold a prominent recovering tool beforehand.

Author Introduction:

Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including corrupt Excel and pdf repair software products. For more information visit www.datanumen.com

Leave a Reply

Your email address will not be published. Required fields are marked *