VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "CONNECTOR"
Attribute VB_Creatable = True
Attribute VB_Exposed = True
Attribute VB_Description = "AddIn Example 2"
' This class connects the add-in to the VB menu.

Dim clickHandler As AddInClass
Dim NewMenu As VBIDE.SubMenu
Dim MenuLines As VBIDE.MenuLine
Dim ConnectID As Long
Dim thisInstance As VBIDE.Application

Sub ConnectAddIn(VBInstance As VBIDE.Application)

    Set thisInstance = VBInstance
    Set clickHandler = New AddInClass

    Set NewMenu = thisInstance.AddInMenu.MenuItems.AddMenu("&New Menu")
    Set MenuLines = NewMenu.MenuItems.Add("&First Option")
    CConnectID = MenuLines.ConnectEvents(clickHandler)
End Sub

Sub DisconnectAddIn(Mode As Integer)
    MenuLines.DisconnectEvents ConnectID
    NewMenu.MenuItems.Remove MenuLines
    thisInstance.AddInMenu.MenuItems.Remove NewMenu
End Sub
