Access.2007.VBA.Bibl..

(John Hannent) #1
Public Sub AddInErr(errX As ErrObject)

Displays message box with error information

Dim strMsg As String

strMsg = _
“An error occurred in the “ & App.Title _
& vbCrLf & “Error #:” & errX.Number _
& vbCrLf & “Description: “ & errX.Description
MsgBox strMsg, , “Error!”

End Sub

The AccessDesigner Module ..........................................................................

The COM add-in needs several entries in the Declarations section of the AccessDesigner module.
To open the designer module, open the Designers folder in the project tree, right-click the
AccessDesigner item, and select View Code from the context menu, as shown in Figure 13.7.

FIGURE 13.7
Opening the AccessDesigner code module.

The standard designer code needs some modifications to enable it to work with add-in events that
fire when the add-in is loaded or unloaded, or when the host application (Access in this case) starts
or shuts down. These events are implemented via the IDTExtensibility2 library, using the
Implementsline at the beginning of the module.

Part III Adding More Functionality to Office

Free download pdf