locked
only show navigation pane in one document RRS feed

  • Question

  • HI

    I have a document(DocA) with a lot of headings, and I always use the navigation pane in it . The problem is that if I show navigation pane in this document and close it with navigation pane, then when I open other documents, they will show navigation pane, too.

    But If I close the navigation pane when I close that document(DocA) , it will be ok with other files. But I have to open the navigation pane again when I open the document(DocA), I have to repeat to open the navigation pane. It is really annoying.

    Can I just show the navigation pane in only one document and don't affect other documents? Any ways?

    Thursday, April 27, 2017 9:12 AM

Answers

  • Hello,Maddyoli

    You can use a macro. And please remember put this code in the “Normal” project.

    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
    please note:
    1. In code line “strDocName = “Sample.docx””, replace the “Sample.docx” with your file name.
    2. In code line “strDocpath = “E:\Temp”, replace the “E:\Temp” with the path of the folder where the file is stored. Remember there is no “\” in the end.

    More details here

    https://www.datanumen.com/blogs/2-ways-show-navigation-pane-one-specific-word-document/

    Good luck



    • Marked as answer by Maddyoli Tuesday, May 2, 2017 6:27 AM
    • Edited by CNL777 Friday, May 5, 2017 9:50 AM
    Friday, April 28, 2017 6:26 AM
  • Hi,

    The Navigation pane is a global setting in Word. It will turn on/off for all Word documents. What you required is not possible with Word build-in options. Here is an article which provided two method to achieve this goal via macro:

    https://www.datanumen.com/blogs/2-ways-show-navigation-pane-one-specific-word-document/

    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    You may try both methods and choose the one that fulfills your requirements.

    Hope this helps.

    Regards,

    Steve Fan


    Please remember to mark the replies as answers if they helped.

    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    • Edited by Steve Fan Friday, April 28, 2017 1:01 PM
    • Marked as answer by Maddyoli Tuesday, May 2, 2017 6:27 AM
    Friday, April 28, 2017 1:00 PM

All replies

  • Hello,Maddyoli

    You can use a macro. And please remember put this code in the “Normal” project.

    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
    please note:
    1. In code line “strDocName = “Sample.docx””, replace the “Sample.docx” with your file name.
    2. In code line “strDocpath = “E:\Temp”, replace the “E:\Temp” with the path of the folder where the file is stored. Remember there is no “\” in the end.

    More details here

    https://www.datanumen.com/blogs/2-ways-show-navigation-pane-one-specific-word-document/

    Good luck



    • Marked as answer by Maddyoli Tuesday, May 2, 2017 6:27 AM
    • Edited by CNL777 Friday, May 5, 2017 9:50 AM
    Friday, April 28, 2017 6:26 AM
  • Hi,

    The Navigation pane is a global setting in Word. It will turn on/off for all Word documents. What you required is not possible with Word build-in options. Here is an article which provided two method to achieve this goal via macro:

    https://www.datanumen.com/blogs/2-ways-show-navigation-pane-one-specific-word-document/

    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    You may try both methods and choose the one that fulfills your requirements.

    Hope this helps.

    Regards,

    Steve Fan


    Please remember to mark the replies as answers if they helped.

    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    • Edited by Steve Fan Friday, April 28, 2017 1:01 PM
    • Marked as answer by Maddyoli Tuesday, May 2, 2017 6:27 AM
    Friday, April 28, 2017 1:00 PM
  • Hey,steven

    Thanks for the link. It's useful to me

    Tuesday, May 2, 2017 6:30 AM
  • hi,CNL

    Thanks for the code. It works

    Tuesday, May 2, 2017 6:31 AM
  • You're welcome :)

    Steve Fan


    Please remember to mark the replies as answers if they helped.

    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, May 8, 2017 3:11 AM