How to render a calendar to an ASP page with CDO

Article translations Article translations
Article ID: 181483 - View products that this article applies to.
This article was previously published under Q181483
Expand all | Collapse all

SUMMARY

This article contains sample code that will use Collaboration Data Objects (CDO) to render a calendar to an Active Server Pages (ASP) page.

Note In order for this sample to work, Microsoft Outlook Web Access (OWA) must be installed on either the IIS computer or the Exchange Server computer. OWA is a separate component installed from the Exchange Server setup program.

MORE INFORMATION

This is a simple example of how you can render your daily calendar to a Web browser using an ASP page with VBScript and CDO.

Copy and paste the following code to an ASP page. Modify the variables that set the server and mailbox to appropriate values. This code requires Microsoft Exchange Server version 5.5.

Here is the code:
   <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
   <HTML>
   <HEAD>

   </HEAD>
   <BODY>
   <%

   '========================================================
   'CONSTANTS FOR THE CONTAINER RENDERER

   'Time Zone Constants for the US
   CONST CdoDefaultFolderCalendar   = 0
   CONST CdoTmzEastern              = 10
   CONST CdoTmzCentral              = 11
   CONST CdoTmzMountain             = 12
   CONST CdoTmzPacific              = 13
   '========================================================
   'CONTAINER CONSTANT
   CONST CdoClassContainerRenderer  = 3

   strProfileInfo = "MyServer" & vbLf & "MyMailbox"
   Set objSession = Server.CreateObject("MAPI.Session")
   objSession.Logon "", "", False, True, 0, True, strProfileInfo
   objSession.SetOption "calendarstore", "outlook"
   Set objRenderApp = Server.CreateObject("AMHTML.application")
   Set objCRenderer = _
      objRenderApp.CreateRenderer(CdoClassContainerRenderer)
   ObjCRenderer.TimeZone = CdoTmzPacific
   objCRenderer.DataSource = _
      objSession.GetDefaultFolder(CdoDefaultFolderCalendar).Messages
   Set objView = ObjCRenderer.Views("Daily Calendar")
   objCRenderer.CurrentView = objView
   objView.RenderAppointments now, Response
   %>

   </BODY>
   </HTML>
				

Properties

Article ID: 181483 - Last Review: February 22, 2007 - Revision: 3.3
APPLIES TO
  • Microsoft Collaboration Data Objects 1.2
  • Microsoft Exchange 2000 Server Standard Edition
  • Microsoft Exchange Server 5.5 Standard Edition
Keywords: 
kbcode kbfaq kbhowto kbmsg KB181483

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com