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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send outlook calendar reminder 1

Status
Not open for further replies.

Shift838

IS-IT--Management
Jan 27, 2003
987
US
Is there a way to send an email in VBA for MS Access 2007 that will mark a date on someones outlook calendar. Like a meeting request?
 
I found this code somewhere and modified it, I cant remember where it originated but it works. It creates an ics file which you then attach to an email and send. This can then be imported into outlook

Dim DTSTART, dtEnd, strSubject, strLocation, strDesc, mymonth, myday, BuildVCalendar, dtstamp, stampmonth, stampday
Dim minushour As Integer 'difference in hours local time to GMT
Dim mehourstart As Integer ' start time of meeting
Dim mehourend As Integer 'end time of meeting
Dim texthourstart As String
Dim texthourend As String
Dim Start_date As Date
Dim End_date As Date
Dim mymonthend, mydayend

Start_date = Me.StartDate
End_date = Me.StartDate

'Note fix date/time as outlook needs date/time in GMT

Me.VCal = "BEGIN:VCALENDAR" & vbCrLf & _
"METHOD:pUBLISH" & vbCrLf & _
"VERSION:1.0" & vbCrLf & _
"BEGIN: VEVENT" & vbCrLf & _
"DTSTART:" & DTSTART & vbCrLf & _
"DTEND:" & dtEnd & vbCrLf & _
"SUMMARY;ENCODING=QUOTED-PRINTABLE:" & strSubject & vbCrLf & _
"DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" & strDesc & vbCrLf & _
"Location;ENCODING=QUOTED-PRINTABLE:" & strLocation & vbCrLf & _
"UID:" & DTSTART & strSubject & vbCrLf & _
"PRIORITY:3" & vbCrLf & _
"DTSTAMP:" & dtstamp & vbCrLf & _
"BEGIN:VALARM" & vbCrLf & _
"ACTION:DISPLAY" & vbCrLf & _
"DESCRIPTION:REMINDER" & vbCrLf & _
"TRIGGER;RELATED=START:pT00H15M00S" & vbCrLf & _
"End:VALARM" & vbCrLf & _
"End:VEVENT" & vbCrLf & _
"End:VCALENDAR" & vbCrLf

'save to text file
DoCmd.GoToControl "Vcal"
Open "<temp path name>….\filename.ics" For Output As #1
'Print #1, Date ' This is for the date
'Print #1, Time ' This is for the time
Print #1, Me.VCal.text
Close #1

You then attract the .ics file to the email
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top