2 Replies Latest reply on Jul 24, 2014 6:35 AM by joseph.spang1

    How to find button in a toolbar?


      Hi All,


      I'm trying to use the following script to add button to a toolbar.

      I have no problem to add button but the command to find the button did not works!



      Dim stdToolBar
      Set stdToolBar = Gui.CommandBars("Standard")


      Dim stdTBCtrls


      'This command didn't works "FindBtnByToolTip"
      Set stdTBCtrls = FindBtnByToolTip("Fit All", tbStandard)


      If stdTBCtrls Is Nothing Then
             Set stdTBCtrls = stdToolBar.Controls
             Dim btnFA
             Set btnFA = stdTBCtrls.Add(cmdControlButton,,,15)
             btnFA.OnAction = "za"
             btnFA.TooltipText = "Fit All"
             btnFA.DescriptionText = "Fit all data to screen"
             btnFA.BitmapFile ="M:\CES_Standards\Expedition\PCB\Icons\view_all.bmp"
      End If