Custom run time CommandBar for navigation

M

Marguerite

Hello Everyone

Word 97 - does anyone still remember it?

After reading the document description (end of post), perhaps there is
no need for a custom CommandBar at all, and you can suggest a much
simpler alternative (but I would still like to understand something
please).

"Document map" would be perfect, but it's not used within the company.
Navigation at the moment is a bookmark on the first ToC page, but the
ToC spans several pages and it is not an especially convenient or fast
method.

I've done macros for template toolbars before, but never this sort of
thing. I know Access VBA reasonably well but am almost ignorant of
Word VBA. I've never used the CommandBar collection in either of them.

The CreateBookmarkMenu() on the MVP site got me started:
http://word.mvps.org/faqs/customization/bookmarkstomenucontent.htm

Question 1.
The following AutoOpen code is included in the above and I don't
understand what it means - can you explain it please?

Sub AutoOpen()
'Make sure the document's menu is visible when the document opens
'If the "customisation context" has been changed since it was last
opened,
'the document-specific menus won't be visible!
CustomizationContext = ActiveDocument
End Sub

Question 2.
My possible solution works, but I don't know how stable it would be,
and I don't know how to implement it properly<s>.
I'm happy to post the code if it will help, but it's the distribution
concept I don't understand.

The code creates the Nav menu and puts a copy of the formatted ToC in
a new temporary document then unlinks it. A loop goes through the ToC
paragraphs and creates a submenu for each TOC 1 style, and a flyout
for each related TOC 2 style until the next TOC 1 style. The page # is
stored in the ToC 2 tag and used in the OnAction function. As per the
example on the mvp site, the last item in the submenu is to refresh
the ToC page numbers (not the whole ToC but that that may change) and
recreate the menu.

I've put all the code in the template, and there's a button on the
template toolbar to launch it for the first time. The resulting menu
is saved with the document - is that how it should be implemented?

Document description:

Used for product function testing during three production or customer
acceptance stages. The content has to be approved by the customer
before use and they normally receive it in pdf format, but sometimes
the Word file is issued (for approval only).

Only 350+ pages, but most of the content is tables (17 columns) filled
with function tests and checks. Some tables span many pages, and more
than one Chapter will often have approx 70 tables. Three Heading
styles are used, Heading 1 Chapter, Heading 2 Function tests and
Heading 3 Checks, the latter are not included in the ToC.

When defining the content, Page Layout view is used so the table
heading rows are always visible - it's too easy to forget where you
are in Normal or Outline view. Different sections of the product might
be very similar and/or have some same function tests, but they might
be functionally different in part

Many thanks for any help, regards
Marguerite
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top