Where are office build-in resource ID definitions?

H

Hurry Wood

I want to use FindControl method to find Menu Item "Tools", but I dont know
what it's tag and id definition is. Where are office build-in resource ID
definitions?
 
G

George Nicholson

Running this will print the ID's for the controls of the specified
Menu/Toolbar in the VBE Immediate window

Public Sub ListControlIDs(strMenuName As String)
Dim mnuBar As CommandBar
Dim mnuControl As CommandBarControl

Set mnuBar = CommandBars(strMenuName)
Debug.Print "Control.ID"; Tab(12); "Type"; Tab(18); "Tag"; Tab(28);
"Caption"
Debug.Print "----------"; Tab(12); "----"; Tab(18); "---"; Tab(28);
"-------"
For Each mnuControl In mnuBar.Controls
Debug.Print mnuControl.ID; Tab(12); mnuControl.Type; Tab(18);
mnuControl.tag; Tab(28); mnuControl.Caption
Next mnuControl
Set mnuBar = Nothing
Set mnuControl = Nothing
End Sub

HTH,
 

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