icon message box

A

Art®

I have created a macro that shows a dialog box with all my installed
printers where I work. My question is if there is any way to have the macro
icon's yellow message box show the name of the currently selected printer
when the user hovers the mouse over it? This would be similar to what now
happens when I hover my mouse above the printer icon in Word. How would I go
about controlling the message box for an macro's icon?

TIA,

Art®
 
F

fumei via OfficeKB.com

Not very easily at all. If this is a custom dialog (do you mean userform????)
, why not simply show the value of the current printer as a Label on it? That
would be straightforward, and uncomplicated.

Trying to create custom MouseOver-like events is a pain.
 
J

Jay Freedman

I suspect Art means that he has a custom toolbar button that launches his
macro, and he wants the toolbar button's tooltip (the "yellow message box")
to display the name of the selected printer, so the user knows whether to
click the button and change the selection.

The macro (or the code behind the userform) could set the button's tooltip
after the user makes a new selection. Here's an example from the Help topic
on the TooltipText property:

Set myMenuBar = CommandBars.ActiveMenuBar
Set lastCtrl = myMenuBar _
.Controls(myMenuBar.Controls.Count)
lastCtrl.TooltipText = "Click for help on UI feature"

Also look up the Help topic on the FindControl method of the CommandBars
collection, and use that method to replace the Set statements above. It
would be useful to assign a value to the button's .Tag property so you can
find it easily.

Be careful, though: the action of changing the TooltipText "dirties" the
template that contains the toolbar button. So the macro must save the
template immediately; otherwise, when the user closes the document (or Word,
if the template is global) there will be a prompt asking whether to save the
template, which the user may not even know about.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Z

zkid

Hmm, that's a tough one. Would you be satisifed with just creating a label
showing the default printer in the dialog box above the rest of the list?
Since you haven't provided any code, we don't know exactly how you've gone
about this. Are you using a list box? Combo box?
 

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