Can I do this in a toolbar?

D

Dawn Rhoads

Hi -- There are a couple of page set up settings that I would like to be able
to see on a toolbar for any document I am in -- the page size (e.g. letter or
A4) and the paper tray source for printing. Would be extra cool if I could
use the buttons to change the settings as well, like with a drop-down list,
similar to changing font size or that kind of thing.

Closest thing I can find in the standard buttons is the "page setup" button,
but I can't find any standard buttons for the individual settings in the page
setup area.

Even if the button could just display the current info, and then I'd have to
click the page setup button if I needed to change the settings, that would be
helpful.

Thanks in advance for any ideas anyone can offer!
 
J

Jezebel

You can modify the captions on toolbars to display anything you like, so you
could have a menu whose caption is the current printer or paper size; and
the menu options would be printer or page size selections.
 
D

Dawn Rhoads

Cool, that sounds like what I am looking for. But, I am not sure what the
"caption" of a toolbar is, where do I set that? Is it a caption on a
toolbar, or on a button on the toolbar?

Thanks for your help!
 
J

Jezebel

Toolbars and menus are actually part of Office, not part of Word, although
you can access them through the Word object model. Use the Object Browser in
VBA to have a look at the CommandBars object. Each toolbar and menu is a
CommandBar with a collection of controls. Captions and buttons are actually
the same thing: CommandBarControls. The difference is whether you choose to
display the caption or the icon or both. Controls either call a macro, or
present other options in some way.

The button or menu option last clicked is referenced through
CommandBars.ActionControl.

As an experiment, create a menu option that points to this macro --

Public Sub ToggleMenu()

Static pToggle As Boolean

pToggle = Not pToggle
CommandBars.ActionControl.Caption = CStr(pToggle)

End Sub
 
D

Dawn Rhoads

Rats, sounds like this is way more complicated than I will be able to
accomplish. I got the button to show true/false when clicked by using your
macro below. I can see that the macro is changing the "name" of the button
when the macros is run. But, I don't have any clue how to modify it to show
the page size or paper tray source. Alas, I am no a programmer! :) I can
manage to record a macro and do minor manipulation of exisitng macros, but
that's about it.

If you have time to provide code that would create buttons like I am
thinking of that would be great (but I understand if not) -- I didn't realize
it would be at this high a level of programming skills needed! Appreciate
the time you have devoted already, thanks!
 

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