It's not pretty, but it creates a calendar file for Outlook:
<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library" -->
<%
'server.execute "../header.htm"
od = Request.QuerySt ring("sdate")
et = Request.QuerySt ring("eTime")
set oShell = CreateObject("W Script.Shell")
atb = "HKEY_LOCAL_MAC HINE\System\Cur rentControlSet\ " &_
"Control\TimeZo neInformation\A ctiveTimeBias"
offsetMin = oShell.RegRead( atb)
nd = dateadd("n", offsetMin, od)
ed = dateadd("n", offsetMin, et)
' Response.Write( "Current = " & od & "<br>UTC = " & ed)
strLocation = Request.QuerySt ring("location" )
strSubject = "I-request"
strDescription = "test"
' -- Format it properly as YYYYMMDDThhmmss Z
if Month(nd) < 10 Then
strMonth = "0" & Right(Month(nd) , 1)
Else strMonth = Month(nd)
End if
if Day(nd) < 10 Then
strDay = "0" & Right(Day(nd), 1)
Else strDay = Day(nd)
End if
if Hour(nd) < 10 Then
strHour = "0" & Right(Hour(nd), 1)
Else strHour = Hour(nd)
End if
if Minute(nd) < 10 Then
strMinute = "0" & Right(Minute(nd ), 1)
Else strMinute = Minute(nd)
End if
if Month(ed) < 10 Then
streMonth = "0" & Right(Month(ed) , 1)
Else streMonth = Month(ed)
End if
if Day(ed) < 10 Then
streDay = "0" & Right(Day(ed), 1)
Else streDay = Day(ed)
End if
if Hour(ed) < 10 Then
streHour = "0" & Right(Hour(ed), 1)
Else streHour = Hour(ed)
End if
if Minute(ed) < 10 Then
streMinute = "0" & Right(Minute(ed ), 1)
Else streMinute = Minute(ed)
End if
' response.write streMinute
If StrMonth = "01" Then
dts = 1
Elseif StrMonth = "02" Then
dts = 1
Elseif StrMonth = "03" Then
dts = 1
Elseif StrMonth = "04" Then
dts = 0
Elseif StrMonth = "05" Then
dts = 0
Elseif StrMonth = "06" Then
dts = 0
Elseif StrMonth = "07" Then
dts = 0
Elseif StrMonth = "08" Then
dts = 0
Elseif StrMonth = "09" Then
dts = 0
Elseif StrMonth = "10" Then
dts = 0
Elseif StrMonth = "11" Then
dts = 1
Elseif StrMonth = "12" Then
dts = 1
End if
strHour = strHour + dts
streHour = streHour + dts
if strHour < 10 Then
strHour = "0" & Right(strHour, 1)
End if
if streHour < 10 Then
streHour = "0" & Right(streHour, 1)
End if
dtStart = Right(Year(nd), 4) & strMonth & strDay & "T" & strHour &
strMinute & "00" & "Z"
dtEnd = Right(Year(ed), 4) & streMonth & streDay & "T" & streHour &
streMinute & "00" & "Z"
' Response.Write dtStart & vbCrLf & dtEnd & vbCrLf
strvCalendar = "BEGIN:VCALENDA R" & vbCrLf & _
"VERSION:1. 0" & vbCrLf & _
"BEGIN:VEVE NT" & vbCrLf & _
"DTSTART:" & dtStart & vbCrLf & _
"DTEND:" & dtEnd & vbCrLf & _
"LOCATION;ENCOD ING=QUOTED-PRINTABLE:" & strLocation & vbCrLf & _
"UID:" & strStart & strSubject & vbCrLf & _
"DESCRIPTION;EN CODING=QUOTED-PRINTABLE:" & strDescription & vbCrLf & _
"SUMMARY;ENCODI NG=QUOTED-PRINTABLE:" & strSubject & vbCrLf & _
"PRIORITY:3 " & vbCrLf & _
"END:VEVENT " & vbCrLf & _
"END:VCALEN DAR" & vbCrLf
Response.Conten tType = "text/x-vCalendar"
Response.AddHea der "Content-Disposition", _
"filename=Event " & "cal.vcs"
Response.Write strvCalendar
Response.End
' Response.Write dtStart
%>
"Mark Schupp" <no******@email .net> wrote in message
news:uL******** ******@TK2MSFTN GP12.phx.gbl...
I think you are confusing hyperlink problems with content type problems.
What does cal.asp do? It appears that the browser is expected to open a
helper app (as you would expect Excel to open for an XLS file). This can
be dependant on the helper function being configured properly under IE.
--
--Mark Schupp
"Tom Petersen" <pe****@sdsd.sd bor.edu> wrote in message
news:ug******** ******@TK2MSFTN GP15.phx.gbl... Thanks! That corrects my syntax problem but IE still doesn't like
something. I may rethink how I am passing the variables to avoid
'special characters' and format the date and time and not include spaces...
Response.Write strEncodedURL output:
cal.asp?sdate=1 0%2F18%2F2006+8 %3A00+AM&locati on=Library&eTim e=10%2F18%2F200 6 +9%3A00+AM
IE: hyperlink value
http://sd-school/forms/cal.asp?sdate...2006+9%3A00+AM Firefox: hyperlink value
http://sd-school/forms/cal.asp?sdate...2006+9%3A00+AM
The error with IE is:
Internet Explorer cannot download 00+AM from SD-school, where as Firefox
opens the outlook ready appointment screen where I just have to hit save
and
close to add it to my calendar.
"Mark Schupp" <no******@email .net> wrote in message
news:uX******** ******@TK2MSFTN GP10.phx.gbl... <%
strEncodedURL = "cal.asp?sdate= " & Server.URLencod e(strDate1) & _
"&location= " & Server.URLencod e(strLocation) & _
"&eTime=" & Server.URLencod e(strDate2)
%>
click <a href="<%=strEnc odedURL%>">here </a> to add this
--
--Mark Schupp
"Tom Petersen" <pe****@sdsd.sd bor.edu> wrote in message
news:OP******** ******@tk2msftn gp13.phx.gbl...
> That sounds like what I need, but I am having problems with the
syntax of > this too. My IDE doesn't like the format, I think the <% %> are
throwing > it
> off.
>
> I think I am close with this:
> strURL = "<% =strDate1 %>&location=<% =strLocation %>&eTime=<%
> =strDate2
> %>"
> strEncodedURL = Server.URLencod e(strURL)
> click <a href="cal.asp?s date=& strEncodedURL"> here</a> to add this
> information to your Calendar<br>
>
> or maybe this:
> strURL = "cal.asp?sdate= <% =strDate1 %>&location=<% =strLocation
> %>&eTime=<%
> =strDate2 %>"
> strEncodedURL = Server.URLencod e(strURL)
> click <a href="& strEncodedURL"> here</a> to add this information to
> your
> Calendar<br>
>
> It seems with the <% commands it doesn't know where asp ends and html
> begins, neither do I! :)
>
>
> "Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
> news:uG******** ******@TK2MSFTN GP10.phx.gbl...
>> Tom Petersen wrote:
>> > I must have the format of the below line wrong for IE:
>> >
>> > click <a href="cal.asp?s date=<% =strDate1 %>&location=<%
>> > =strLocation
>> > %>&eTime=<% =strDate2 %>">here</a> to add this information to your
>> > Calendar<br>
>> >
>> > When I hover my mouse over the link, the status bar at the bottom
of >> > the page for IE says: shortcut to 2006 11:00 AM
>> > With Firefox I get:
http://sd-school/forms/cal.asp?sdate=10/18/2006 >> > 10:00 AM&location=Lib rary&eTime=10/18/2006 11:00 AM
>> >
>> > The form works in Firefox, which is what I use for testing. So
>> > either the format is wrong, or IE doesn't like the spaces or
>> > something. It doesn't matter which dates I use, I get the same
>> > results.
>> >
>> > Any ideas?
>> Use Server.urlencod e to fix the querystring part of the url.
>> --
>> Microsoft MVP - ASP/ASP.NET
>> Please reply to the newsgroup. This email account is my spam trap so
I >> don't check it very often. If you must reply off-line, then remove
the >> "NO SPAM"
>>
>>
>
>