I want to send a calendar appointment from Alpha, presumably using an email, but I'm not sure how to go about it. I've seen some links on the message board, but most of them are very old.
Is anyone doing this?
Is anyone doing this?
Alpha Software Mobile Development Tools: Alpha Anywhere | Alpha TransForm |
FUNCTION createIcal AS P (startDate as T, endDate as T, eventID as C, title as C, description as C, fileName as C) dim output as C = "" dim ret as P '.ics file defination dim file_path as C = "C:\temp\mycalendar" dim file_name as C = "interview_schedule" dim file_ext as C = ".ics" 'For create event in .ics file dim ical_UID as C = "" dim ical_summary as C = "" dim ical_description as C = "" dim ical_dtStart as C = "" dim ical_dtEnd as C = "" dim ical_eventString as C = "" 'Get system setting for calendar file path dim setting_file_path as C = "" if setting_file_path <> "" then file_path = setting_file_path end if if fileName <> "" then file_name = fileName end if ret.icalFile = filename_decode(file_path + "\\" + file_name + file_ext) 'create the calendar file's contents dim calendarHeader as C = "BEGIN:VCALENDAR" + crlf() +\ "VERSION:2.0" + crlf() +\ "PRODID:-//Calendar Labs//Calendar 1.0//EN" + crlf() +\ "CALSCALE:GREGORIAN" + crlf() +\ "METHOD:PUBLISH" + crlf() "BEGIN:VTIMEZONE" + crlf() +\ "TZID:Eastern_Time" + crlf() +\ "X-LIC-LOCATION:Eastern_Time" + crlf() +\ "BEGIN:DAYLIGHT" + crlf() +\ "TZOFFSETFROM:-0500" + crlf() +\ "TZOFFSETTO:-0400" + crlf() +\ "TZNAME:EDT" + crlf() +\ "DTSTART:19700308T020000" + crlf() +\ "RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3" + crlf() +\ "END:DAYLIGHT" + crlf() +\ "BEGIN:STANDARD" + crlf() +\ "TZOFFSETFROM:-0400" + crlf() +\ "TZOFFSETTO:-0500" + crlf() +\ "TZNAME:EST" + crlf() +\ "DTSTART:19701101T020000" + crlf() +\ "RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11" + crlf() +\ "END:STANDARD" + crlf() +\ "END:VTIMEZONE" output = calendarHeader + crlf() ical_UID = eventID ical_summary = stritran(stritran(title,"\\","\\\"),",","\,") ical_summary = stritran(title,";","\;") 'this didn't work when added to line above for some reason ical_description = stritran(stritran(description,"\\","\\\"),",","\,") ical_description = stritran(description,";","\;") ical_dtStart = "DTSTART;VALUE=DATE-TIME:" + time("yyyyMMdd", startDate) + "T" + time("0h0m0s", startDate) ical_dtEnd = "DTEND;VALUE=DATE-TIME:" + time("yyyyMMdd", endDate) + "T" + time("0h0m0s", endDate) eventString = "BEGIN:VEVENT" + crlf() + "UID:" + ical_UID + crlf() + "SUMMARY:" + ical_summary + crlf() + "DESCRIPTION:" + ical_description + crlf() +\ ical_dtStart + crlf() + ical_dtEnd + crlf() + "TRANSP:OPAQUE" + crlf() + "STATUS:CONFIRMED" + crlf() + "END:VEVENT" output = output + eventString + crlf() output = output + "END:VCALENDAR" if file.exists(file_path) == .f. then if dir_create_recurse(file_path) == .f. then ret.error = .t. ret.error_msg = "[Could not create calendar file [Fail to create folder \"" + file_path + "\"]" return end if end if if file.exists(file_path) then if save_to_file(output, ret.icalFile, .f.) then 'file created else ret.error = .t. ret.error_msg = "Could not create calendar file [Fail to save to file]" end if end if createIcal = ret END FUNCTION
Comment