VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "MenuLineClass"
Attribute VB_Creatable = True
Attribute VB_Exposed = False
Option Explicit

Public VBInstance As Object
Public MyMenuCaption As String

Public Sub AfterClick()
Dim i%, j%
Dim MyProperty As Object
Dim testControl As Object
If Not CheckForDirt() Then
    Select Case Left$(MyMenuCaption, 5)
    Case "&Load"    'load previously saved toolbar
        Load tbLoadFrm
    Case Else   'save current toolbar
        Load tbSaveForm
    End Select
End If
End Sub

Private Function CheckForDirt() As Boolean
Dim CurrFormName$, i%
With gobjIDEAppInst.ActiveProject
    CurrFormName$ = .ActiveForm.Properties.Item("Name")
    With .Components
        For i% = 0 To .Count - 1
            If .Item(i%).Name = CurrFormName$ Then
                If .Item(i%).IsDirty Then
                    CheckForDirt = True
                    Beep
                    Alert "Please save " & CurrFormName$ & " before attempting to load or save a toolbar."

                  Exit Function
                End If
            End If
        Next
    End With
End With

End Function
