Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-13-2014, 02:16 AM
NobodysPerfect NobodysPerfect is offline Navigation pane Show.Heading level x only Windows 7 64bit Navigation pane Show.Heading level x only Office 2010 32bit
Competent Performer
Navigation pane Show.Heading level x only
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default Navigation pane Show.Heading level x only

Hi to all,



unfortunately in Word 2010 Navigation pane is fully expanded whenever I open it. Of course right-clicking in the pane I can set the heading level to whatever level, but the setting (obvioulsy) isn't saved.

In 2003 two simple code lines in an _Open macro fixed the problem:
Code:
ActiveWindow.View.ShowHeading x
ActiveWindow.DocumentMap = True
But with 2010 this code doesn't work anymore. Whatever ShowHeading level I try, Navigation pane always shows default '3'. The code doesn't throw any error nor does it work - it is simply ignored.

Any ideas how to make the Navigation pane show only the specified heading level?

Thanks
NP
Reply With Quote
  #2  
Old 04-13-2014, 01:10 PM
macropod's Avatar
macropod macropod is offline Navigation pane Show.Heading level x only Windows 7 32bit Navigation pane Show.Heading level x only Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The code works for me.
.ShowHeading = x, which only works in outline view, displays all headings down to the level specified.
.DocumentMap = True displays the document map - which always includes all headings except for the ones you manually hide.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-09-2014, 01:56 AM
NobodysPerfect NobodysPerfect is offline Navigation pane Show.Heading level x only Windows 7 64bit Navigation pane Show.Heading level x only Office 2010 32bit
Competent Performer
Navigation pane Show.Heading level x only
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

Hi Paul,

You're right, I mixed two things up.

But my issue still remains. Working with longer document I often use the Navigation Pane, which - by default - displays all used heading levels. With more than one level displayed it is (for long) documents quite confusing. I still have to scroll and look, scroll and look, ... so I manually reduce the Navigations Panes' appearance to Heading 1 level (right click in the Navigation Pane and
'Reduce all levels' command).

But as I use the 'Application.ShowWindowsInTaskbar = False' option, whenever I change documents, the Navigation Pane again uses the default stetting = all heading levels. A very annoying behavior, because then I again have to reduce the number of shown heading levels.

My solution right now is a Sendkeys sequence in the 'Document_Change' event. It seems to work reliably but I am not one for Sendkeys solutions.

That's why I'm still looking for a 'reduce all levels' (for Naviagtion Pane) command in VBA. Maybe I got a bit stuck in a rut with that command, but I really wasn't able to find a straight VBA way to change the Navigation Pane display behavior.

If you can help - great, if there is no solution, I will stick at 'my Sendkeys' until I notice some 'misbehavior'.

NP
Reply With Quote
  #4  
Old 05-09-2014, 02:43 AM
macropod's Avatar
macropod macropod is offline Navigation pane Show.Heading level x only Windows 7 32bit Navigation pane Show.Heading level x only Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You might do better to hook into the WindowActivate(ByVal Doc As Document, ByVal Wn As Window) event and run your code against whatever window is active. You should be able to use:
Wn.View.ShowHeading x
Wn.DocumentMap = True
from there.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 05-09-2014, 03:17 AM
NobodysPerfect NobodysPerfect is offline Navigation pane Show.Heading level x only Windows 7 64bit Navigation pane Show.Heading level x only Office 2010 32bit
Competent Performer
Navigation pane Show.Heading level x only
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

Sorry no,

it doesn't work. As posted in #1, whatever heading level I select, the code is simply ignored. All heading levels are displayed in Navigation Pane.

NP
Reply With Quote
  #6  
Old 05-09-2014, 03:36 AM
macropod's Avatar
macropod macropod is offline Navigation pane Show.Heading level x only Windows 7 32bit Navigation pane Show.Heading level x only Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

It works for me. Have you checked that the event is firing?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 05-09-2014, 04:08 AM
NobodysPerfect NobodysPerfect is offline Navigation pane Show.Heading level x only Windows 7 64bit Navigation pane Show.Heading level x only Office 2010 32bit
Competent Performer
Navigation pane Show.Heading level x only
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

Yes,

I always use msgbox(es) when testing events

Code:
ActiveWindow.View.ShowHeading 1
MsgBox "Event - First Box"
ActiveWindow.DocumentMap = True
MsgBox "Event - Second Box"
Shows first and second box, DocumentMap is executed, ShowHeading not.


I mean, this cannot be some localization bug? I encountered this issue a few times in German forums. Exactly the same => ShowHeading = ignored


Strange behavior
NP
Reply With Quote
  #8  
Old 05-09-2014, 04:11 AM
macropod's Avatar
macropod macropod is offline Navigation pane Show.Heading level x only Windows 7 32bit Navigation pane Show.Heading level x only Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I suppose it could be a localization bug, but that's not something I can test right now.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 05-09-2014, 04:26 AM
NobodysPerfect NobodysPerfect is offline Navigation pane Show.Heading level x only Windows 7 64bit Navigation pane Show.Heading level x only Office 2010 32bit
Competent Performer
Navigation pane Show.Heading level x only
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

That's what I also found

Quote:
This reference explains that in Word 2010 ShowHeading is used for setting the outline level in the main window of a document in outline view, not the level in the document map pane, as in previous versions of Word.

http://msdn.microsoft.com/en-us/library/ff836914.aspx
Quote taken from http://www.justanswer.com/computer-p...oopen-set.html

But why does it work for you and not for me? Your event really changes the displayed heading levels in Navigation Pane?

NP
Reply With Quote
  #10  
Old 05-09-2014, 04:28 AM
macropod's Avatar
macropod macropod is offline Navigation pane Show.Heading level x only Windows 7 32bit Navigation pane Show.Heading level x only Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The code works equally well for me using:
Code:
Private Sub wdApp_WindowActivate(ByVal Doc As Document, ByVal Wn As Window)
Wn.View.ShowHeading 1
Wn.DocumentMap = True
End Sub
or:
Code:
Private Sub wdApp_WindowActivate(ByVal Doc As Document, ByVal Wn As Window)
Doc.ActiveWindow.View.ShowHeading 1
Doc.ActiveWindow.DocumentMap = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #11  
Old 05-09-2014, 04:42 AM
NobodysPerfect NobodysPerfect is offline Navigation pane Show.Heading level x only Windows 7 64bit Navigation pane Show.Heading level x only Office 2010 32bit
Competent Performer
Navigation pane Show.Heading level x only
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

It definitely does not. Even if I change to Outline view ...

Code:
Wn.View.Type = wdOutlineView
Wn.View.ShowHeading 1
Wn.DocumentMap = True
... in Outline view itself, only heading level 1 ist displayed, but within the Navigation Pane still all levels.

NP
Reply With Quote
  #12  
Old 05-09-2014, 05:26 AM
macropod's Avatar
macropod macropod is offline Navigation pane Show.Heading level x only Windows 7 32bit Navigation pane Show.Heading level x only Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Ah, OK, I've still been thinking in terms of Outline View.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Navigation pane Show.Heading level x only Navigation pane - default setting blazed Word 11 08-13-2021 05:13 AM
Navigation pane Show.Heading level x only SEQ fields not showing in navigation pane eNGiNe Word 14 12-14-2016 06:10 PM
Navigation pane Show.Heading level x only Heading level numbering in 2010 - wrong after second header level 1 taran Word 3 07-08-2013 01:12 PM
Navigation Pane savo Word 2 04-17-2013 07:14 AM
Tasks Navigation Pane 2007 nikainr Outlook 0 05-30-2011 04:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:10 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft