strTitle
Cancel = True
GoTo ErrorHandlerExitCase vbTuesday, vbThursdayDate is a Tuesday or Thursday; put up message and continue:strTitle = “Right day of week”
strPrompt = “Review date OK”
MsgBox strPrompt, vbOKOnly + vbInformation, _
strTitleEnd SelectEnd IfErrorHandlerExit:
Exit SubErrorHandler:
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExitEnd SubTo work with Outlook items in code, you need to set a reference to the Outlook object
library (select Tools➪References in the Visual Basic window, as shown in Figure 4.2). To
avoid creating multiple instances of Outlook, I like to use an error handler that will open a new instance
of Outlook using CreateObjectif the GetObjectfunction fails because Outlook is not running.FIGURE 4.2
Setting a reference to the Outlook object library.NOTENOTE
Part I The Office Components and What They Do Best