Function ClickMenuButtonByNum(menuBarH, buttonNum)
    menuButtonBounds = menuBarH.Object.VisibleLinks.Item(buttonNum).Bounds
    boundsArray = Split(menuButtonBounds, ",")
    boundsXArray = Split(boundsArray(0), "=")
    iX = boundsXArray(1)
    boundsYArray = Split(boundsArray(1), "=")
    iY = boundsYArray(1)
    menuBarH.Click iX, iY
End Function

Function ClickMenuButtonByName(menuBarH, buttonName)
    buttonCount =  menuBarH.Object.VisibleLinks.Count
    For i = 0 to buttonCount - 1
        Set buttonItem = menuBarH.Object.VisibleLinks.Item(i)
        If buttonItem.Caption = buttonName Then
            menuButtonBounds = buttonItem.Bounds
            boundsArray = Split(menuButtonBounds, ",")
            boundsXArray = Split(boundsArray(0), "=")
            iX = boundsXArray(1)
            boundsYArray = Split(boundsArray(1), "=")
            iY = boundsYArray(1)
            menuBarH.Click iX, iY
        End If
    Next
End Function