Access.2007.VBA.Bibl..

(John Hannent) #1
ErrorHandlerExit:
Exit Function

ErrorHandler:

Outlook is not running; open Outlook with CreateObject.

If Err.Number = 429 Then
Set appOutlook = CreateObject(“Outlook.Application”)
Resume Next
Else
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExit
End If

End Function

Figure 8.26 shows one of the tasks created by this procedure.

FIGURE 8.26
A task created from data in an Access table.

Working with Outlook Contacts........................................................................................


Outlook offers a convenient and attractive interface for working with contacts (though, as noted
earlier in this chapter, it does not support linking companies to contacts or other one-to-many
links). Most people keep Outlook open at all times, whereas they may only open an Access data-
base as needed. Because of this, if you have a single table of Access contacts, you may wish to
export the data to Outlook, so you can quickly open a contact item without having to first open an
Access database.

Part II Writing VBA Code to Exchange Data between Office Components

Free download pdf