I have written an app that allows users to create calendar entries in Outlook. An email is sent to the people attending a meeting with a link that writes a text file with vCalendar information then opens it. The problem I have is that some secretaries have access to other people's mailboxes. Is there anything I can add that will specify whose calendar it should go into?
Any help much appreciated. Thanks.
So far I have:
TBL.Open "SELECT MeetingID, RoomID, Date, StartTime, EndTime, Title, Laptop, Projector FROM Meetings WHERE MeetingID=" & Request.QueryString("MeetingID"), DB
Body=""
If Not TBL.EOF Then
Body = Body & "BEGIN:VCALENDAR" & vbCrlf
Body = Body & "VERSION:1.0" & vbCrlf
Body = Body & "BEGIN: VEVENT" & vbCrlf
Body = Body & "DTStart:" & DatePart("yyyy", TBL("Date"))
If DatePart("m", TBL("Date")) < 10 Then Body = Body & "0"
Body = Body & DatePart("m", TBL("Date"))
If DatePart("d", TBL("Date")) < 10 Then Body = Body & "0"
Body = Body & DatePart("d", TBL("Date")) & "T"
If DatePart("h", TBL("StartTime")) < 10 Then Body = Body & "0"
Body = Body & DatePart("h", TBL("StartTime")) & DatePart("n", TBL("StartTime")) & DatePart("s", TBL("StartTime"))
If DatePart("s", TBL("StartTime")) = 0 Then Body = Body & "00"
Body=Body & "Z" & vbCrlf
Body = Body & "DTEnd:" & DatePart("yyyy", TBL("Date"))
If DatePart("m", TBL("Date")) < 10 Then Body = Body & "0"
Body = Body & DatePart("m", TBL("Date"))
If DatePart("d", TBL("Date")) < 10 Then Body = Body & "0"
Body = Body &DatePart("d", TBL("Date")) & "T"
If DatePart("h", TBL("EndTime")) < 10 Then Body = Body & "0"
Body = Body & DatePart("h", TBL("EndTime")) & DatePart("n", TBL("EndTime")) & DatePart("s", TBL("EndTime"))
If DatePart("s", TBL("EndTime")) = 0 Then Body = Body & "00"
Body = Body & "Z" & vbCrlf
Body = Body & "LOCATION;ENCODING=QUOTED-PRINTABLE:Room " & TBL("RoomID") & vbCrlf
Body = Body & "SUMMARY;ENCODING=QUOTED-PRINTABLE:Meeting - " & TBL("Title") & vbCrlf
Body = Body & vbCrlf
Body = Body & "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" & TBL("Title") & vbCrlf
Body = Body & "End:VEVENT" & vbCrlf
Body = Body & "End:VCALENDAR" & vbCrlf
Response.Write(Body)
End If
TBL.Close
Set TBL=Nothing
Set DB=Nothing
Set fs = CreateObject("Scripting.FileSystemObject")
Set wfile = fs.CreateTextFile("\\bwbsrv01\users\intranets\bwbnet\book\mail\vcard\meeting.vcs", True)
Text=Body
If Len(Text)>0 Then
Response.Write("!")
wfile.Write(Text)
End If
Response.Redirect("vcard\meeting.vcs")
Any help much appreciated. Thanks.
So far I have:
TBL.Open "SELECT MeetingID, RoomID, Date, StartTime, EndTime, Title, Laptop, Projector FROM Meetings WHERE MeetingID=" & Request.QueryString("MeetingID"), DB
Body=""
If Not TBL.EOF Then
Body = Body & "BEGIN:VCALENDAR" & vbCrlf
Body = Body & "VERSION:1.0" & vbCrlf
Body = Body & "BEGIN: VEVENT" & vbCrlf
Body = Body & "DTStart:" & DatePart("yyyy", TBL("Date"))
If DatePart("m", TBL("Date")) < 10 Then Body = Body & "0"
Body = Body & DatePart("m", TBL("Date"))
If DatePart("d", TBL("Date")) < 10 Then Body = Body & "0"
Body = Body & DatePart("d", TBL("Date")) & "T"
If DatePart("h", TBL("StartTime")) < 10 Then Body = Body & "0"
Body = Body & DatePart("h", TBL("StartTime")) & DatePart("n", TBL("StartTime")) & DatePart("s", TBL("StartTime"))
If DatePart("s", TBL("StartTime")) = 0 Then Body = Body & "00"
Body=Body & "Z" & vbCrlf
Body = Body & "DTEnd:" & DatePart("yyyy", TBL("Date"))
If DatePart("m", TBL("Date")) < 10 Then Body = Body & "0"
Body = Body & DatePart("m", TBL("Date"))
If DatePart("d", TBL("Date")) < 10 Then Body = Body & "0"
Body = Body &DatePart("d", TBL("Date")) & "T"
If DatePart("h", TBL("EndTime")) < 10 Then Body = Body & "0"
Body = Body & DatePart("h", TBL("EndTime")) & DatePart("n", TBL("EndTime")) & DatePart("s", TBL("EndTime"))
If DatePart("s", TBL("EndTime")) = 0 Then Body = Body & "00"
Body = Body & "Z" & vbCrlf
Body = Body & "LOCATION;ENCODING=QUOTED-PRINTABLE:Room " & TBL("RoomID") & vbCrlf
Body = Body & "SUMMARY;ENCODING=QUOTED-PRINTABLE:Meeting - " & TBL("Title") & vbCrlf
Body = Body & vbCrlf
Body = Body & "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" & TBL("Title") & vbCrlf
Body = Body & "End:VEVENT" & vbCrlf
Body = Body & "End:VCALENDAR" & vbCrlf
Response.Write(Body)
End If
TBL.Close
Set TBL=Nothing
Set DB=Nothing
Set fs = CreateObject("Scripting.FileSystemObject")
Set wfile = fs.CreateTextFile("\\bwbsrv01\users\intranets\bwbnet\book\mail\vcard\meeting.vcs", True)
Text=Body
If Len(Text)>0 Then
Response.Write("!")
wfile.Write(Text)
End If
Response.Redirect("vcard\meeting.vcs")