ErrorHandler:
AddInErr Err
Resume ErrorHandlerExitEnd SubPrivate Sub frmcbb_Click(ByVal ctl As _
Office.CommandBarButton, CancelDefault As Boolean)On Error Resume NextCall LNCRenameFormControlsEnd SubPrivate Sub rptcbb_Click(ByVal ctl As _
Office.CommandBarButton, CancelDefault As Boolean)On Error Resume NextCall LNCRenameReportControlsEnd SubPublic Function CreateFormCommandBarButton(ByVal _
Application As Object, ByVal ConnectMode _
As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object) As Office.CommandBarButtonOn Error GoTo ErrorHandlerStore a reference to the Application object in a public variable so other procedures in the add-in
can use it.
Set pappAccess = ApplicationReturn a reference to the command bar..
Set cbrMenu = pappAccess.CommandBars(“Form Design”)Add a button to call the add-in from the command bar, if it doesn’t already exist.
Look for the button on the command bar.
Set cbbAddIn = _
cbrMenu.FindControl(Tag:=”Rename Form Controls”)On Error Resume Next
If cbbAddIn Is Nothing ThenCreating COM Add-ins with Visual Basic 6 13