Creating an appointment in outlook from access 2003

D

David C. Holley

Try this (Assuming you have Outlook in stalled on the PC running Access)

Function createOutlookAppointmentFromId(lngTransportId As Long)

Dim objOutlook As Object
Dim newAppt As Object
Dim lngPrimaryPassengerId As Long
Dim strPrimaryPassengerFirstName As String
Dim strPrimaryPassengerLastName As String
Dim rs As DAO.Recordset

Set objOutlook = CreateObject("Outlook.application")
Set newAppt = objOutlook.CreateItem(1)

With newAppt
.Start = glb_dteDate & " " & glb_dteTimeScheduled
.End = glb_dteDate & " " & DateAdd("h", 1,
CDate(glb_dteTimeScheduled))
.Subject = strPrimaryPassenger
.Location = glb_strOrigination & " - " & glb_strDestination
.Body = getBodyText(lngTransportId)
.BusyStatus = 2
If glb_dteDate < Now() Then
.ReminderSet = False
End If
.Categories = "Reservations"
.Save
createOutlookAppointmentFromId = newAppt.EntryID
End With

Set newAppt = Nothing
Set objOutlook = Nothing


End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top