Macro script

D

DR

Is there a generic script for a macro that I could get hold of that, on
play, simply opens up a click-able menu of other macro's? My purpose is to
put two or three of these in a footer, and when one, such as a navigation
thing, is run it opens up a menu that says go to next page and so on. All
macros, invoking and invoked, would be located in the document. I'm aware
that some such functions can be invoked in other ways, and my example is
trivial. Thanks.
 
J

Jezebel

I doubt you'll find a generic script for this.

Read Help on the ShowPopup method: that's how you display a popup menu from
VBA code. Note that in MS terminology, menus and toolbars are all called
CommandBars, and handled in the same way. Menu options are CommandButtons,
the same as buttons on a Toolbar. The menu system is part of Office, not
part of Word. (And talk about a pig's breakfast of software design -- it's a
friggin' nightmare to work with!)

The basic method you'll need is:

1. Create the commandbar itself. You could do this in advance (right click
on any toolbar, select Customize > Toolbars > New), or on the fly via code
as needed. The members of the commandbar's Controls collection will be the
menu options linked to the macros you want to make available.

2. Create a macro that displays the commandbar.

3. Add a MacroButton field to your document to call the displaying macro.
 

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