Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Jul 2002
    Location
    Princes Risborough, Buckinghamshire, England
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    What does my custom menu item do? (2000)

    Names and exact story changed, but this is the gist ...

    Once upon a time I wrote a macro. I called it Foo. Then I wrote another similar macro called Foo2. I created a new customised menu item on a Word toolbar and assigned one of these macros to it, but I can't remember which one. How do I find out which macro is assigned to the toolbar item? My only option at present is to put something like:
    MsgBox "Running Foo2" in every macro I can find. Surely there must be a better way?

  2. #2
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Quakertown, PA, Pennsylvania, USA
    Posts
    517
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: What does my custom menu item do? (2000)

    Hmmm. I'm not sure if this will help, but I know that I've created templates with macros where I built the toolbar using code. My code refers to the button faces used. I use this little tool to get those button faces and reference them in the code:

    http://j-walk.com/ss/excel/tips/tip67.htm

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: What does my custom menu item do? (2000)

    Try looking at the .OnAction property of the control on your command bar.

    StuartR

  4. #4
    New Lounger
    Join Date
    Jul 2002
    Location
    Princes Risborough, Buckinghamshire, England
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: What does my custom menu item do? (2000)

    Thanks StuartR, I've used this property to get the information I need.

    Follow-up question: As an item on a Word Toolbar can be a menu rather than a button, I think I need some recursive code if I want to list details of all the commands on all the toolbars, with details of their .OnAction property. Anyone know of some sample code with this kind of recursion?

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: What does my custom menu item do? (2000)

    I think I've tried to code that before, and encountered a lot of difficulties. Possibly I was looking at the .Count of the .Controls collection of the menu item as a clue to whether it was a pop-up, but it's rather hazy at the moment. Since CommandBars are cross-application, you might check on the VBA board to see if anyone posted anything that enumerates them all.

  6. #6
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: What does my custom menu item do? (2000)

    The below macros should list all toolbars and commands.

  7. #7
    New Lounger
    Join Date
    Jul 2002
    Location
    Princes Risborough, Buckinghamshire, England
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: What does my custom menu item do? (2000)

    Klaus,

    Thanks for this code. If I produce a nice version listing the information I want too, I'll post it.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Peter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •