Public WithEvents PasteImmMenuHandler As CommandBarEvents 'Command Bar Event Handler
Attribute PasteImmMenuHandler.VB_VarHelpID = -1
Public WithEvents AddNewMenuHandler As CommandBarEvents 'Command Bar Event Handler
Attribute AddNewMenuHandler.VB_VarHelpID = -1
Public WithEvents DeleteCodeMenuHandler As CommandBarEvents
Attribute DeleteCodeMenuHandler.VB_VarHelpID = -1
'Change this to suit your needs
Const TOOLBOX As String = "C:\Program Files\Microsoft Visual Studio\Common\Tools\CodeLibrary\CodeSamples.mdb" 'Location Of Your Code Library Database
'Use of Windows native Message box circumvents the VB MsgBox 1024 character limit for long code snippets
Private Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
Private Sub AddinInstance_OnConnection(ByVal Application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As Object, custom() As Variant)
On Error GoTo Err_Handler
Set db = DAO.OpenDatabase(TOOLBOX)
Set VBI = Application
'If you want to add a separate toolbar instead of adding controls to the standard toolbar
'replace the code between the '** lines with the lines commented out below