|
The following code will loop through the Band and Tool collections and return the Band type (0-Normal, 1-Menu, etc.) and the captions of the Tools on that Band. Private Sub Command1_Click()
Dim tool As ActiveBar2LibraryCtl.tool
Set tool = GetTool("Band1")
End Sub
Private Function GetTool(ByVal bandName As String) As ActiveBar2LibraryCtl.tool
Dim x As Integer
For x = 0 To ActiveBar21.Bands(bandName).Tools.Count - 1
Debug.Print ActiveBar21.Bands(bandName).Tools(x).Caption, ActiveBar21.Bands(bandName).Type
If ActiveBar21.Bands(bandName).Tools(x).Caption = toolCaption Then
Set GetTool = ActiveBar21.Bands(bandName).Tools(x)
Exit For
End If
Next
End Function
Applies To: ActiveBar 2.0
|