2017-07-26 10 views
0

私は古典的なasp Webページにリンクを作成して、それをクリックするとOutlookに予定を追加しようとしています。まず、テストを行うために、私はOutlookで作成し、私のページにリンクした後の.icsと.vcsという2つの形式で保存しました。メインブラウザ用の古典的なasp WebアプリケーションでOutlookの予定リンクを生成

私はそれらを実行したときに、.vcsはFirefoxとChromeでは動作しないことに気づき、.icsはFirefoxでしか動作しないので、おそらくこの最後のものを選択します。

私の質問は、他の形式やFirefoxから.icsファイルを開く方法はありますか?それを認識したり、Outlookウィンドウを開くことはできません。

ありがとうございました!

答えて

1

Experts-Exchangeにこのソリューションを超える見つけ、完全な信用はそれらに行く:

Sub createICS (sTitle, sDesc, sDate, sStartT, eDate, sEndT, sFName) 
    Response.Buffer = True 
    server.ScriptTimeout = 3000 
    Set objFSO = CreateObject("Scripting.FileSystemObject") 
    Dim iFile : Set iFile = objFSO.CreateTextFile(sFName, TRUE) 
     iFile.WriteLine("BEGIN:VCALENDAR") 
     iFile.WriteLine("PRODID:Microsoft CDO for Microsoft Exchange") 
     iFile.WriteLine("VERSION:2.0") 
     iFile.WriteLine("METHOD:PUBLISH") 
     iFile.WriteLine("BEGIN:VEVENT") 
     iFile.WriteLine("DTSTAMP:"&dateToUTC (DATE(), TIME())) 
     Dim dtStart, dtEnd 
     dtStart = "DTSTART:" & dateToUTC (sDate, sStartT) 
     dtEnd = "DTEND:" & dateToUTC (eDate, sEndT) 
     iFile.WriteLine(dtStart) 
     iFile.WriteLine(dtEnd) 
     iFile.WriteLine("UID:{A6DEF157-DFCE-40F4-AC77-217563191E7B}") 
     iFile.WriteLine("SUMMARY:" & sTitle) 
     iFile.WriteLine("DESCRIPTION:" & sDesc) 
     iFile.WriteLine("SEQUENCE:0") 
     iFile.WriteLine("PRIORITY:3") 
     iFile.WriteLine("CLASS:Personal") 
     iFile.WriteLine("STATUS:CONFIRMED") 
     iFile.WriteLine("TRANSP:OPAQUE") 
     iFile.WriteLine("X-MICROSOFT-CDO-BUSYSTATUS:BUSY") 
     iFile.WriteLine("X-MICROSOFT-CDO-INSTTYPE:0") 
     iFile.WriteLine("BEGIN:VALARM") 
     iFile.WriteLine("TRIGGER:PT10M") 
     iFile.WriteLine("ACTION:DISPLAY") 
     iFile.WriteLine("DESCRIPTION:Reminder") 
     iFile.WriteLine("END:VALARM") 
     iFile.WriteLine("END:VEVENT") 
     iFile.WriteLine("END:VCALENDAR") 
    iFile.close() 
End Sub 
Function dateToUTC (sDate, sTime) 
    Dim iHour, iMin, iYear, iMonth, iDay, tDate, tTime 
    tDate = DateValue(sDate) 
    tTime = TimeValue(sTime) 
    iHour = Hour(DateAdd("h", 4, tTime)) 'correction for US Eastern time 
    iMin = Minute(tTime) 
    iYear = Year(tDate) 
    iMonth = Month(tDate) 
    iDay = Day(tDate) 
    Dim s : s = iYear 
    if iMonth < 10 then s = s & "0" 
     s = s & iMonth 
    if iDay < 10 then s = s & "0" 
     s = s & iDay & "T" 
    if iHour < 10 then s = s & "0" 
     s = s & iHour 
    if iMin < 10 then s = s & "0" 
     s = s & iMin & "00Z" 
    dateToUTC = s 
End Function 



if request.querystring("a") = 1 then 
    strPath = server.mappath("/temp.ics") 
    Call createICS ("The Title", "The Description", formatdatetime(now,2), formatdatetime(now,4), formatdatetime(now+1,2), formatdatetime(now+1,2), strPath) 

    'do your emailing stuff here and when you add the attachment to the code use the strPath variable as in above 
end if 
%> 
<a href="/temp2.asp?a=1">Click Here For It</a> 
関連する問題