Access.2007.VBA.Bibl..

(John Hannent) #1
FIGURE 8.20

The Outlook “Publish Form As” dialog box, showing the message class of a custom Outlook form.


Working with Outlook Appointments ..............................................................................


You may have calendar (appointment) data stored in an Access table, perhaps dating back to before
Outlook became a part of Office. Because Outlook has a much richer interface for working with
calendars than Access, I recommend exporting the Access calendar data to Outlook and working
with it in Outlook calendars in the future.

To export data from an Access appointments table (such as the table from the sample Events data-
base, called tblEvents) to Outlook appointments, use the function listed next (it can also be run
from the mcrExportAppointments macro):

Public Function ExportAppointmentsToOutlook()

On Error GoTo ErrorHandler

Dim fldCalendar As Outlook.Folder
Dim appt As Outlook.AppointmentItem
Dim strApptName As String
Dim dteStartTime As Date
Dim dteEndTime As Date
Dim strStatus As String
Dim lngStatus As Long

Set appOutlook = GetObject(, “Outlook.Application”)
Set nms = appOutlook.GetNamespace(“MAPI”)
Set fldCalendar = nms.GetDefaultFolder(olFolderCalendar)

Working with Outlook Items 8

Free download pdf