Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Possible to email an appointment from Access ?

Status
Not open for further replies.

Topkapi

IS-IT--Management
Sep 4, 2001
97
GB
I'm not sure if what I'm asking here is totally stupid as I'm pretty much a novice with Access. I've seen various threads here providing very detailed code on how to create and send a "normal" email message from Access, but none mentioning sending an apppointment. The idea being that this would then appear in a mail enabled public folder on an Exchange 2003 server.

Is this possible ?

Any comments gratefully received.
 
Try the below code. I did a quick search for outlook's object model and found a very nice sample below (not my code)

Code:
Public Function CreateAppointment(SubjectStr As String, BodyStr As String, StartTime As Date, EndTime As Date, AllDay As Boolean)
     Dim OlApp As Outlook.Application
     Dim Appt As Outlook.AppointmentItem

     Set OlApp = CreateObject("Outlook.Application")
     Set Appt = OlApp.CreateItem(olAppointmentItem)

     Appt.Subject = SubjectStr
     Appt.Start = StartTime
     Appt.End = EndTime
     Appt.AllDayEvent = AllDay
     Appt.BOdy = BodyStr
     Appt.Save
     Set Appt = Nothing
     Set OlApp = Nothing
End Function

Below is an example of how to call this function

Code:
Private Sub testsub()
     CreateAppointment "John Test", "This is the body", Now(), Now + 1, True
End Sub
 
Thanks very much ! I'll try that and let you know how I get on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top