PDA

View Full Version : Popup for headings and or bookmarks



Dave T
03-22-2010, 05:28 PM
Hello All,

I posted this message in another forum, but the responses are received via individual e-mails, so I thought I’d try a different forum where all replies are in the same place so my apologies if some consider this cross posting.

When I use Excel 2003 I have a macro I use for quick navigation between worksheets within a workbook.

Sub SheetList()
On Error Resume Next
Application.CommandBars("Workbook Tabs").Controls("More Sheets...").Execute
If Err.Number > 0 Then
Err.Clear
Application.CommandBars("Workbook Tabs").ShowPopup
End If
On Error GoTo 0
End Sub

Being a VBA novice I was wondering if there was a Word 2003 version that functions in the same or similar way???
I have looked at the Document Map, which is very similar to what I am after but this stays open and reduces screen size.
Is there Word VBA version of the Excel macro that creates a Word VBA version of the Excel macro which creates a popup that lets you select a heading, click on it to go to it and then the popup closes???

Some replies I have had suggested:
Hafizullah suggested:
Perhaps Edit | Go To (Ctrl-G from the keyboard) will meet your needs
In that built-in dialog, you get the choice of Page, Section, Line, Bookmark, Comment, Footnote, Endnote, Field, Table, Graphic, Equation, Object, Heading. and it’s modeless, so you can keep it up if you wish and work behind it.
Bear suggested:
I'd suggest you create a custom userform with a list box to display the headings, select one, and go to it.
If your headings are all Heading styles, then you can use the method GetCrossReferenceItems(ReferenceType:=wdRefTypeHeading) to load the list with all these headings.
If you need to list headings that have a variety of styles, I can't think of any way to develop the list other than by working through the paragraphs collection, determining the paragraph style, and if it's one of the ones you want, adding the text of the paragraph to the list. Of course, the longer your document, the longer this will take.
Once a list item is selected, you can "go to" the heading using the Find method.

Any help or comments appreciated.

Regards,
Dave T

Paul_Hossler
03-22-2010, 06:45 PM
Since I always use styles (Heading 1, Heading 2, etc.) I can use Outline View, and select Display Level 1 or 2 or 3.

That gives me a something like a hyper linked TOC that I can click and go to the paragraph heading

Paul

Dave T
03-22-2010, 07:03 PM
Hello Paul,

Thanks for the reply.

I always tend to work in Print Layout view and was kind of hoping a quick popup menu accessed via a button at the top of each page would enable me to quickly move around the document.

Maybe I have become too set in my ways.

Regards,
Dave T

Paul_Hossler
03-22-2010, 07:17 PM
If you're using Word2007 AND you using styles, there's the document map.

It's clickable

Paul

lucas
03-23-2010, 09:27 AM
Popup for headings and or bookmarks

Try this for bookmarks. See attached.

The userform opens when the doc is opened but a navigation button is added to the main menu next to help in 2003

Paul_Hossler
03-26-2010, 05:27 AM
Sheeeh - I'm still working on coming to grips with Word 2007 and 2010 is here

Anyway, this 2010 navigarion feature seems like it might be the reason to go to 2010

(or at least the reason to get that 30 inch widescreen monitor)


http://blogs.msdn.com/microsoft_office_word/archive/2009/08/03/the-navigation-pane.aspx

Paul