The AccessDesigner code is listed next, with the specific modifications needed to implement the
add-in’s functionality, using the event procedures supported by the IDTExtensibility2 library to cre-
ate command bar buttons, and assign procedures to them. The module also contains the proce-
dures used to do control renaming:Implements IDTExtensibility2Private WithEvents frmcbb As Office.CommandBarButton
Private WithEvents rptcbb As Office.CommandBarButtonGlobal variable to store reference to host application (Access)Public pappAccess As Access.ApplicationRegular variables for creating toolbar buttonsPrivate cbrMenu As Office.CommandBar
Private cbbAddIn As Office.CommandBarButtonPublic variables for handling renamingPublic pctl As Access.Control
Public pdbs As DAO.Database
Public pfrm As Access.Form
Public pintRenameFail As Integer
Public pintReturn As Integer
Public plngControlType As Long
Public prpt As Access.Report
Public prst As DAO.Recordset
Public pstrMessage As String
Public pstrNewCtlName As String
Public pstrOldCtlName As String
Public pstrSQL As String
Public pstrSourceObject As StringPrivate variables for handling renamingPrivate i As Integer
Private blnTag As Boolean
Private intTag As Integer
Private strPrefix As String
Private blnUnbound As Boolean
Private strControlSource As String
Private strCaption As String
Private strObjectName As String
Private strCtlName As StringPart III Adding More Functionality to Office