Access.2007.VBA.Bibl..

(John Hannent) #1
Else
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExit
End If

End Sub

For a list of the built-in Word named constants that can be used as arguments for func-
tions or methods, or set as the values of properties, look up the appropriate enumera-
tion (enum) in the Object Browser. Word enums start with Wd and are at the bottom of the Classes
list. For example, to see what named constants can be used for the WindowState property of the
ActiveWindow property, look up the WdWindowState enum, which is shown in Figure 6.19.

FIGURE 6.19
Examining the WdWindowState enum in the Object Browser.

The cmdDeselectAll_Clickprocedure, run from the Clear All Selections command button,
deselects all the rows in the listbox, even the ones you can’t see, so you can start fresh:

Private Sub cmdDeselectAll_Click()

On Error GoTo ErrorHandler

Set lst = Me![lstSelectContacts]

intRows = lst.ListCount - 1

TIPTIP


Part II Writing VBA Code to Exchange Data between Office Components

Free download pdf