GuidesOutlook Appointments, ASP and vCalendar Page 3

Outlook Appointments, ASP and vCalendar Page 3

ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.




vCalendar and ASP

Now comes the fun part … seeing it work!

Below is posted the text of the ASP page, but due to difficulties with displaying
ASP code within an ASP page, I suggest that you download the
code and use that copy of the page instead of trying to copy and paste the code below.

The page is mostly self-explanatory for those familiar with ASP. In a nutshell, it
draws several input boxes on the screen that collect the information we want in our
appointment item: Start, End, Subject, Location and Description. The user is also
asked for a directory (on the server) where the file should be created. Of course
this wouldn’t be done in production, but I included it in the ASP code since it is
necessary for the VB Class, and must be provided somewhere. It could be hard-coded
and in my example, defaults to “C:” if the user provides nothing.

The most important part of the code is where the VCSWrap.ApptItem class is instantiated, its
properties are set and the CreateVCSEvent method is invoked. The vCalendar file is created
and its path is passed to the Response.Redirect method of the ASP page. Since a vcs file
cannot be displayed, it is opened automatically. If the user’s PIM application is
designed to process .vcs files, as Outlook is, an appointment item is opened with all
the properties set from our web page.

        Dim objVCal, VCalFile
        Set objVcal = Server.CreateObject("VCalWrap.ApptItem")

        With objVCal
            .DTStart = DTStart
            .DTEnd = DTEnd
            .Subject = Subject
            .Location = Location
            .Description = Description
            .OutputFilePath = OutputFilePath
            .TimeZoneBias = -7
            .CreateVCSEvent
            VCalFile = .VCalFile
        End With
        Response.Redirect(VCalFile)

Conclusion

Some of you may not immediately see the benefits of this technology while others
are getting excited and anxious to try out the code. Addmittedly, I was not at first
convinced that vCalendar could add value to our web application. Then, our ASP
developer put together code similar to the above and did a demo for the sales and
marketing guys. Their excitement made up for my lack of it and I decided to give the
idea a second look. Although it doesn’t solve every problem, it does make it easy to
“calendar-enable” your web application … and it’s cool to play with!

********* BEGIN ASP PAGE CODE HERE ************************************************ 

   
   
 ‾ਠ瀼敲‾䴼呅⁁潣瑮湥㵴䴢䡓䵔⁌⸵〰㌮〲⸷㔲〰•慮敭䜽久剅呁剏㰾䠯䅅㹄†㰊牰㹥㰠佂奄‾ਠ瀼敲‾䘼剏⁍敭桴摯瀽獯⁴捡楴湯∽敔瑳䍖污愮灳•慮敭∽䍖污㸢†㰊牰㹥㰠牰㹥†㰊牰㹥㰠⁐污杩㵮散瑮牥㰾但呎映捡㵥敖摲湡⁡楳敺㐽‾ਠ瀼敲‾††匼剔乏㹇䍖污湥慤⁲敔瑳倠条㱥匯剔乏㹇⼼但呎㰾倯‾ਠ瀼敲‾┼†㰊牰㹥††䐠浩䐠協慴瑲‬呄湅Ɽ匠扵敪瑣‬潌慣楴湯†㰊牰㹥††䐠浩䐠獥牣灩楴湯‬畏灴瑵楆敬慐桴†㰊牰㹥††䐠浩映楍獳湩䍧楲楴慣䑬瑡ⱡ猠牴獍Ⱨ倠獡⁳ਠ瀼敲‾†䐠協慴瑲㴠删煥敵瑳䘮牯⡭䐢協慴瑲⤢†㰊牰㹥††呄湅⁤‽敒畱獥⹴潆浲∨呄湅≤
†㰊牰㹥††畓橢捥⁴‽敒畱獥⹴潆浲∨畓橢捥≴
ਠ瀼敲‾†䰠捯瑡潩‽敒畱獥⹴潆浲∨潌慣楴湯⤢†㰊牰㹥††敄捳楲瑰潩‽敒畱獥⹴潆浲∨敄捳楲瑰潩≮
ਠ瀼敲‾†传瑵異䙴汩健瑡⁨‽敒畱獥⹴潆浲∨畏灴瑵楆敬慐桴⤢†㰊牰㹥††慐獳㴠删煥敵瑳䘮牯⡭倢獡≳
ਠ瀼敲‾††䵦獩楳杮牃瑩捩污慄慴〽†㰊牰㹥††瑳䵲杳㴠∠•ਠ瀼敲‾††‧畐⁴潳敭搠晥畡瑬瘠污敵⁳湩椠灮瑵戠硯獥†㰊牰㹥††晉䰠湥匨扵敪瑣
‽‰桔湥匠扵敪瑣㴠∠湕敤整浲湩摥•ਠ瀼敲‾†䤠⁦敌⡮潌慣楴湯
‽‰桔湥䰠捯瑡潩‽唢摮瑥牥業敮≤†㰊牰㹥††晉䰠湥䐨獥牣灩楴湯
‽‰桔湥䐠獥牣灩楴湯㴠∠湕敤整浲湩摥•ਠ瀼敲‾†䤠⁦敌⡮畏灴瑵楆敬慐桴
‽‰桔湥†畏灴瑵楆敬慐桴㴠䌢尺•ਠ瀼敲‾†䤠⁦敌⡮慐獳
‽‰桔湥倠獡⁳‽‰ਠ瀼敲‾†䤠⁦慐獳㸠〠吠敨ਠ瀼敲‾†††䤠⁦敌⡮呄瑓牡⥴‽‰剏丠瑯䤠䑳瑡⡥呄瑓牡⥴吠敨†㰊牰㹥†††映楍獳湩䍧楲楴慣䑬瑡㵡‱ਠ瀼敲‾†††瑳䵲杳㴠猠牴獍⁧…㰢潆瑮挠汯牯爽摥䴾獩楳杮瘠污摩猠慴瑲搠瑡⁥湡⁤楴敭㰮䘯湯㹴䈼㹒•ਠ瀼敲‾†††䔠摮䤠⁦ਠ瀼敲‾†††䤠⁦敌⡮呄湅⥤‽‰剏丠瑯䤠䑳瑡⡥呄湅⥤吠敨†㰊牰㹥†††映楍獳湩䍧楲楴慣䑬瑡㵡‱ਠ瀼敲‾†††瑳䵲杳㴠猠牴獍⁧…㰢潆瑮挠汯牯爽摥䴾獩楳杮瘠污摩攠摮搠瑡⁥湡⁤楴敭㰮䘯湯㹴䈼㹒•ਠ瀼敲‾†††䔠摮䤠⁦ਠ瀼敲‾†䔠獬⁥ਠ瀼敲‾†††猠牴獍⁧‽㰢㹂牐癯摩⁥桴⁥潦汬睯湩⁧湩潦浲瑡潩潴挠敲瑡⁥桴⁥灡潰湩浴湥⁴瑩浥㰮戯∾†㰊牰㹥††湅⁤晉†㰊牰㹥††晉映楍獳湩䍧楲楴慣䑬瑡㵡‱牯瀠獡㵳‰桔湥†ਠ瀼敲‾†††敒灳湯敳圮楲整猨牴獍⥧†㰊牰㹥┠朦⁴ਠ瀼敲‾†††䘼乏⁔慦散嘽牥湡慤猠穩㵥㸳†㰊牰㹥†††††䤼偎呕椠㵤硴側獡⁳慮敭倽獡⁳瑳汹㵥嘢卉䉉䱉呉㩙栠摩敤≮瘠污敵∽┼倽獡⁳‫‱☥瑧㸢†㰊牰㹥†††㰠䅔䱂⁅潂摲牥〽愠楬湧挽湥整㹲†㰊牰㹥††††㰠牴‾ਠ瀼敲‾†††††㰠摴匾慴瑲䐠瑡⁥湡⁤楔敭㰺琯㹤†㰊牰㹥††††††琼㹤䤼偎呕愠楬湧爽杩瑨椠㵤硴䑴協慴瑲渠浡㵥呄瑓牡⁴慶畬㵥┼䐽協慴瑲┠朦㱴琯㹤†㰊牰㹥††††††琼㹤䘨牯慭㩴†浭搯⽤祹栠㩨湮愠⽭浰㰩琯㹤†㰊牰㹥††††㰠琯㹲†㰊牰㹥††††㰠牴‾ਠ瀼敲‾†††††㰠摴䔾摮䐠瑡⁥湡⁤楔敭㰺琯㹤†㰊牰㹥††††††琼㹤䤼偎呕愠楬湧爽杩瑨椠㵤硴䑴䕔摮渠浡㵥呄湅⁤慶畬㵥┼䐽䕔摮┠朦㱴琯㹤†㰊牰㹥††††††琼㹤䘨牯慭㩴†浭搯⽤祹栠㩨湮愠⽭浰㰩琯㹤†㰊牰㹥††††㰠琯㹲†㰊牰㹥††††㰠牴‾ਠ瀼敲‾†††††㰠摴匾扵敪瑣㰺琯㹤†㰊牰㹥††††††琼㹤䤼偎呕愠楬湧爽杩瑨椠㵤硴却扵敪瑣渠浡㵥畓橢捥⁴慶畬㵥┼匽扵敪瑣┠朦㹴⼼摴‾ਠ瀼敲‾†††††㰠摴㰾琯㹤†㰊牰㹥††††㰠琯㹲†㰊牰㹥††††㰠牴‾ਠ瀼敲‾†††††㰠摴䰾捯瑡潩㩮⼼摴‾ਠ瀼敲‾†††††㰠摴㰾义啐⁔污杩㵮楲桧⁴摩琽瑸潌慣楴湯渠浡㵥潌慣楴湯瘠污敵㰽㴥潌慣楴湯┠朦㹴⼼摴‾ਠ瀼敲‾†††††㰠摴㰾琯㹤†㰊牰㹥††††㰠琯㹲†㰊牰㹥††††㰠牴‾ਠ瀼敲‾†††††㰠摴䐾獥牣灩楴湯㰺琯㹤†㰊牰㹥††††††琼㹤䤼偎呕愠楬湧爽杩瑨椠㵤硴䑴獥牣灩楴湯渠浡㵥敄捳楲瑰潩慶畬㵥┼䐽獥牣灩楴湯┠朦㹴⼼摴‾ਠ瀼敲‾†††††㰠摴㰾琯㹤†㰊牰㹥††††㰠琯㹲†㰊牰㹥††††㰠牴‾ਠ瀼敲‾†††††㰠摴伾瑵異⁴楆敬倠瑡㩨⼼摴‾ਠ瀼敲‾†††††㰠摴㰾义啐⁔污杩㵮楲桧⁴摩琽瑸畏灴瑵楆敬慐桴渠浡㵥畏灴瑵楆敬慐桴瘠污敵㰽㴥畏灴瑵楆敬慐桴┠朦㹴⼼摴‾ਠ瀼敲‾†††††㰠摴㰾琯㹤†㰊牰㹥††††㰠琯㹲†㰊牰㹥††††㰠牴‾ਠ瀼敲‾†††††㰠摴㰾琯㹤†㰊牰㹥††††††琼㹤䤼偎呕椠㵤畳浢瑩‱慮敭猽扵業ㅴ琠灹㵥畳浢瑩瘠污敵匽扵業㹴⼼摴‾ਠ瀼敲‾†††††㰠摴㰾义啐⁔摩爽獥瑥‱慮敭爽獥瑥‱祴数爽獥瑥瘠污敵刽獥瑥㰾琯㹤†㰊牰㹥††††㰠琯㹲†㰊牰㹥†††㰠䘯乏㹔†㰊牰㹥†††㰠启䉁䕌‾ਠ瀼敲‾┼†㰊牰㹥††汅敳†㰊牰㹥†††䤠⁦敌⡮畓橢捥⥴㴠〠吠敨畓橢捥⁴‽⠢潎匠扵敪瑣䜠癩湥∩†㰊牰㹥†††䤠⁦敌⡮潌慣楴湯
‽‰桔湥䰠捯瑡潩‽⠢潎䰠捯瑡潩楇敶⥮•ਠ瀼敲‾†††晉䰠湥䐨獥牣灩楴湯
‽‰桔湥䐠獥牣灩楴湯㴠∠丨敄捳楲瑰潩楇敶⥮•ਠ瀼敲‾†††楄扯噪慃ⱬ嘠慃䙬汩⁥ਠ瀼敲‾†††敓⁴扯噪慣‽敓癲牥䌮敲瑡佥橢捥⡴嘢慃坬慲⹰灁瑰瑉浥⤢†㰊牰㹥†††圠瑩⁨扯噪慃ਠ瀼敲‾††††⸠呄瑓牡⁴‽呄瑓牡⁴ਠ瀼敲‾††††⸠呄湅⁤‽呄湅⁤ਠ瀼敲‾††††⸠畓橢捥⁴‽畓橢捥⁴ਠ瀼敲‾††††⸠潌慣楴湯㴠䰠捯瑡潩ਠ瀼敲‾††††⸠敄捳楲瑰潩‽敄捳楲瑰潩ਠ瀼敲‾††††⸠畏灴瑵楆敬慐桴㴠传瑵異䙴汩健瑡⁨ਠ瀼敲‾††††⸠楔敭潚敮楂獡㴠ⴠ‷ਠ瀼敲‾††††⸠牃慥整䍖䕓敶瑮†㰊牰㹥†††††䍖污楆敬㴠⸠䍖污楆敬†㰊牰㹥†††䔠摮圠瑩⁨ਠ瀼敲‾†††敒灳湯敳刮摥物捥⡴䍖污楆敬
ਠ瀼敲‾†㰊牰㹥††湅⁤晉†㰊牰㹥†朥⁴ਠ瀼敲‾⼼但䵒‾ਠ瀼敲‾⼼佂奄㰾䠯䵔㹌† †††††† †††㰠瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾瀯敲㰾是湯㹴⼼楤㹶

Get the Free Newsletter!

Subscribe to Daily Tech Insider for top news, trends & analysis

Latest Posts

Related Stories