Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2005

Tip: Looking for answers? Try searching our database.

tool tips for macros

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
papagru - 03 Feb 2005 05:09 GMT
How do I create a hovering tooltip for a macro button; Word 2002
koolnuts - 03 Feb 2005 08:21 GMT
If it is a toolbar button which runs a macro, then you can set the tooltip by:

CommandBars("CommandBarName").Controls("ControlName").TooltipText  = "Click
for help on ..."
or

 Set myCtrl = CommandBars.ActionControl
 myCtrl.TooltipText = "Click for help on ..."
 .....
 Set myCtrl = nothing

If it is a MacroButton field - I am sorry but I don't know of a way to set a
tooltip on a field.

Regards
koolnuts

> How do I create a hovering tooltip for a macro button; Word 2002
papagru - 03 Feb 2005 13:43 GMT
it is a button that runs a macro, and your answer looks authoritative to me.
However, I know less than you think. It looks like I am supposed to plop
these lines into the macro, and I will try this.  But can you tell me a
little more about what each line does.
Many thanks
P

> If it is a toolbar button which runs a macro, then you can set the tooltip by:
>
[quoted text clipped - 14 lines]
>
> > How do I create a hovering tooltip for a macro button; Word 2002
papagru - 03 Feb 2005 14:25 GMT
Trying to make my question very specific. Here's a *macro* to convert a
selection to Sentence case. When I hover over the button, it says LC where I
wish it would say "sentence case".
Sub LC()
' LC Macro sets sentence case
   Selection.Range.Case = wdTitleWord
End Sub
So what would I type in to do that?
P

> it is a button that runs a macro, and your answer looks authoritative to me.
> However, I know less than you think. It looks like I am supposed to plop
[quoted text clipped - 21 lines]
> >
> > > How do I create a hovering tooltip for a macro button; Word 2002
Charles Kenyon - 03 Feb 2005 16:15 GMT
The quick and dirty way to do it is to name your macro SentenceCase. The
default tooltip for the button will be "Sentence Case." I know that you can
also use vba to assign a tooltip other than the name to a particular button,
but I've never bothered to learn how to do this. It would, though, be a
separate macro that you run once to assign the tooltip, not everytime your
referenced macro is run.
Signature


Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

> Trying to make my question very specific. Here's a *macro* to convert a
> selection to Sentence case. When I hover over the button, it says LC where
[quoted text clipped - 36 lines]
>> >
>> > > How do I create a hovering tooltip for a macro button; Word 2002
koolnuts - 03 Feb 2005 16:25 GMT
How are you creating the button on the toolbar / CommandBar?

There are at least two ways to do this:

1. is through code, which then allows you to change the tooltiptext
property, eg.

Sub MyCreateCommandBar
Dim cbar As CommandBar
Set cbar = CommandBars.Add(Name:="CommandBarName", Position:=msoBarTop,
Temporary:=False)

With CommandBars.Item("CommandBarName").Controls
       ' Add cmdToggleBold button
       .Add Type:=msoControlButton, ID:=1
       .Item(1).Caption = "Toggle Bold"
       .Item(1).DescriptionText = "Toggle Bold"
       .Item(1).TooltipText = "some text some text some text some text"
       .Item(1).FaceId = 113
       .Item(1).OnAction = "cmdToggleBold"
       .Item(1).Enabled = True
End With
cbar.Visible = True
cbar.Enabled = True
set cbar = nothing
End Sub

You would then call MyCreateCommandBar from an AutoExec or AutoOpen or
AutoNew macro which ever is appropriate.

2. is by customising a commandbar in Word, eg.
Tools->Customise->Commands->Macros->select a macro name and drag it to the
CommandBar. Unfortunately this does not allow you to change the TooltipText
property other than by using code.

CommandBars("CommandBarName").Controls("ControlName").TooltipText  = "Click
for help on ..."

which you would then also put into a AutoExec or AutoOpen or AutoNew macro
so it would setup the button as soon as the document is opened, executed
(AutoExec for loading global templates / documents) or created (AutoNew).

> Trying to make my question very specific. Here's a *macro* to convert a
> selection to Sentence case. When I hover over the button, it says LC where I
[quoted text clipped - 31 lines]
> > >
> > > > How do I create a hovering tooltip for a macro button; Word 2002
p - 03 Feb 2005 16:53 GMT
Thanx, I really appreciate your help and time.
P

> How are you creating the button on the toolbar / CommandBar?
>
[quoted text clipped - 73 lines]
> > > >
> > > > > How do I create a hovering tooltip for a macro button; Word 2002
Robert Werner - 26 Jul 2005 14:52 GMT
How is it possible to set an AutoOpen macro to run another macro.

After following this thread I changed the macro name to AutoOpen for hiding
a standard toolbar and displaying my custom toolbar. The macro now works the
way i had originally intended, but it occurs to me that there may be other
macros i'd like to run using AutoOpen. So perhaps i can set up a series of
macros then run them by referenc ein the AutoOpen macro. Is that how it works?
Being new to VB I'm not sure how to do the scripting nor what can be done.



> How do I create a hovering tooltip for a macro button; Word 2002
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.