Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-04-2012, 09:42 AM
New Daddy New Daddy is offline How do you find what command a toolbar button represents? Windows Vista How do you find what command a toolbar button represents? Office 2003
Advanced Beginner
How do you find what command a toolbar button represents?
 
Join Date: Jan 2012
Posts: 90
New Daddy is on a distinguished road
Question How do you find what command a toolbar button represents?

How do you find what command a toolbar button represents?



I'd like to import the function of some of the tool bar buttons on the "Reviewing" toolbar into a customized "Reviewing" menu. It turns out that I use some of the buttons on the "Reviewing" tool bar quite frequently, but the rest almost never. So, by importing these frequently used functions into a newly built menu, I will be able to claim more real estate for text editing. But the problem is, I don't know what "command" these toolbar buttons represent. I wish there was a "property" menu when you right-click a toolbar that displays such information.

Is there any easy way to find out what command a particular toolbar button executes?
Reply With Quote
  #2  
Old 05-04-2012, 05:52 PM
Charles Kenyon Charles Kenyon is offline How do you find what command a toolbar button represents? Windows Vista How do you find what command a toolbar button represents? Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

You can create a new toolbar and simply copy the buttons you want from the Reviewing toolbar by Ctrl-Dragging them there.

I don't know the answer to your question so started with the macro listed at http://word.mvps.org/FAQs/MacrosVBA/...roToButton.htm and came up with the following which gives the caption (tooltip) and the button ID.

Code:
Sub ShowCaptionandID()

Dim oToolbar As CommandBar
Dim oButton As CommandBarControl

On Error Resume Next

'Replace the name if you've used another toolbar
Set oToolbar = CommandBars("Formatting")

For Each oButton In oToolbar.Controls

    'Check if it is a customized button

    If oButton.BuiltIn Then
        MsgBox oButton.Caption & " " & oButton.ID & " " ' & oButton.OnAction
    End If
    
Next

Set oButton = Nothing
Set oToolbar = Nothing

End Sub
To find the commands in the Customize list, look under All Commands. You really want to find them on the menus. For instance FileOpen. Unfortunately, most of them are not on the menus.
Reply With Quote
  #3  
Old 05-04-2012, 06:51 PM
New Daddy New Daddy is offline How do you find what command a toolbar button represents? Windows Vista How do you find what command a toolbar button represents? Office 2003
Advanced Beginner
How do you find what command a toolbar button represents?
 
Join Date: Jan 2012
Posts: 90
New Daddy is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
You can create a new toolbar and simply copy the buttons you want from the Reviewing toolbar by Ctrl-Dragging them there.

I don't know the answer to your question so started with the macro listed at http://word.mvps.org/FAQs/MacrosVBA/...roToButton.htm and came up with the following which gives the caption (tooltip) and the button ID.
Thanks. From the button ID, how do you find the command in the all commands list? For example, the Accept/Reject Dialog Box button has the button ID of 305. Where do I go from there? (I wasn't able to find the Accept/Reject Dialog Box command in the all commands list, while I was able to find separate Accept Changes and Reject Changes commands.)
Reply With Quote
  #4  
Old 05-04-2012, 07:22 PM
Charles Kenyon Charles Kenyon is offline How do you find what command a toolbar button represents? Windows Vista How do you find what command a toolbar button represents? Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Did you try, with the Customize dialog open, Ctrl-dragging the buttons you want to your toolbar?

The button IDs are useful for trying to programmatically build a toolbar but I don't think that is what you are trying to do.
Reply With Quote
  #5  
Old 05-04-2012, 07:26 PM
New Daddy New Daddy is offline How do you find what command a toolbar button represents? Windows Vista How do you find what command a toolbar button represents? Office 2003
Advanced Beginner
How do you find what command a toolbar button represents?
 
Join Date: Jan 2012
Posts: 90
New Daddy is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
Did you try, with the Customize dialog open, Ctrl-dragging the buttons you want to your toolbar?

The button IDs are useful for trying to programmatically build a toolbar but I don't think that is what you are trying to do.
Yes, I'm cognizant of how you can move/copy a button from one toolbar to another. But here I'm trying to replicate a command represented by a toolbar button in a menu. It's just that all of my toolbars are already full (i.e., flush to the right margin of the screen), so I can't copy this particular button to any other toolbar without making them disappear into a drop-down button.
Reply With Quote
  #6  
Old 05-04-2012, 09:05 PM
Charles Kenyon Charles Kenyon is offline How do you find what command a toolbar button represents? Windows Vista How do you find what command a toolbar button represents? Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Copy the button to your menu. I made a menu with all the commands from the Reviewing toolbar in 2 minutes. It displays the commands as well as the button images by default. (These are not necessarily the commands that are on the All Commands list, though.)

Last edited by Charles Kenyon; 05-05-2012 at 03:28 AM.
Reply With Quote
  #7  
Old 05-05-2012, 12:35 PM
New Daddy New Daddy is offline How do you find what command a toolbar button represents? Windows Vista How do you find what command a toolbar button represents? Office 2003
Advanced Beginner
How do you find what command a toolbar button represents?
 
Join Date: Jan 2012
Posts: 90
New Daddy is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
Copy the button to your menu. I made a menu with all the commands from the Reviewing toolbar in 2 minutes. It displays the commands as well as the button images by default. (These are not necessarily the commands that are on the All Commands list, though.)
OMG, you are absolutely right!
It never occurred to me that a button on a toolbar and a menu item in the menubar are interchangeable.

Thanks!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you find what command a toolbar button represents? How do I enable a button in the quick access toolbar dpb001 Word VBA 1 05-02-2012 12:41 AM
How do you find what command a toolbar button represents? Email button on quick access toolbar castman Word 3 01-17-2012 02:24 PM
Check Boxes and Command Buttons Micky P Word VBA 0 10-27-2011 01:06 AM
How do you find what command a toolbar button represents? Command Button cksm4 Word VBA 7 02-27-2011 08:47 PM
How do you find what command a toolbar button represents? Run Outside application from toolbar button Richard Harison Word 3 12-20-2005 03:22 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft