home *** CD-ROM | disk | FTP | other *** search
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- END
- Attribute VB_Name = "RunAddIn"
- Attribute VB_Creatable = True
- Attribute VB_Exposed = True
- Option Explicit
-
- 'Storage for the instance of VBInstance given to us in ConnectAddIn
- Dim ThisInstance As Object
- 'Storage for the menu and menuline objects created when the add-in adds its own menu
- 'and menulines to Visual Basic
- Dim RunMenuLine As Object
- 'Set up ionstances of the menu line Clicked() Event Handlers
- Dim RunHandler As New DoDoRunRun
- 'Storage for the cookies that are passed back
- 'from ConnectEvents
- Dim RunConnectCookie As Long
-
- Sub ConnectAddIn(VBInstance As Object)
- Set ThisInstance = VBInstance
- Set RunMenuLine = ThisInstance.AddInMenu.MenuItems.Add("Run...")
- Set RunHandler.VBInstance = VBInstance
- RunConnectCookie = RunMenuLine.ConnectEvents(RunHandler)
- End Sub
-
- Sub DisconnectAddIn(Mode As Integer)
- RunMenuLine.DisconnectEvents RunConnectCookie
- ThisInstance.AddInMenu.MenuItems.Remove RunMenuLine
- End Sub
-