Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(“tblEvents”)With rst
Do While Not .EOFCheck that there is an appointment subject.strApptName = Nz(![Title])
Debug.Print “Appointment name: “ & strApptName
If strApptName = “” Then
GoTo NextAppt
End IfCheck for valid dates, and convert blank dates into 1/1/4501 (that is a blank date in Outlook).If IsNull(![Start Time]) = True Then
dteStartTime = #1/1/4501#
Else
dteStartTime = Nz(![Start Time])
End IfIf IsNull(![End Time]) = True Then
dteEndTime = #1/1/4501#
Else
dteEndTime = Nz(![End Time])
End IfCreate a new appointment item in the local Calendar folder.Set appt = fldCalendar.Items.Add
appt.Subject = strApptName
appt.Start = dteStartTime
appt.End = dteEndTime
appt.Location = Nz(![Location])
appt.Body = Nz(![Description])
appt.Close (olSave)NextAppt:
.MoveNext
Loop
End WithMsgBox “Appointments exported to Outlook”ErrorHandlerExit:
Exit FunctionErrorHandler:Part II Writing VBA Code to Exchange Data between Office Components
