|
|
|
date: Sun, 25 Feb 2007 00:05:03 -0800,
group: microsoft.public.exchange.development
back
Display a Calendar from a Exchange 2003 Mailbox in a web page
Hi All,
I was hoping someone may be able to provide me with some sample ASP (or
ASP.Net) code for displaying a Daily, Weekly or Monthly view of a Calendar
from a Exchange 2003 mailbox in a web page.
The MS Support Knowledgebase Article 181483 provides the following example
but this example won't work with Exchange 2003.
<!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>
The MSDN libary has the following comment with respect to the rendering
objects.
The Collaboration Data Objects (CDO) 1.2.1 Rendering objects are not
installed by or supported for use with
Exchange Server 2003 or later.
I've done numerous web searches but can't find a solution.
date: Sun, 25 Feb 2007 00:05:03 -0800
author: Les
Re: Display a Calendar from a Exchange 2003 Mailbox in a web page
The easiest method of doing this is to use a Iframe and just host OWA
calendar this is a bit old but should still work with Exchange 2003 see
http://msdn2.microsoft.com/en-us/library/ms974600.aspx.
Otherwise you need to look at building something that logs onto the Exchange
store and queries the calendar in question and then supplies whatever
control you want to use in the format that is required. Eg something like
http://msdn2.microsoft.com/en-us/library/aa123570.aspx is an example of
using one of the Exchange API's to query a calendar.
Cheers
Glen
"Les" wrote in message
news:51CAD22A-5F87-4C00-A890-EBB8CDB10DAF@microsoft.com...
>
> Hi All,
>
> I was hoping someone may be able to provide me with some sample ASP (or
> ASP.Net) code for displaying a Daily, Weekly or Monthly view of a Calendar
> from a Exchange 2003 mailbox in a web page.
>
> The MS Support Knowledgebase Article 181483 provides the following example
> but this example won't work with Exchange 2003.
>
> <!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>
>
> The MSDN libary has the following comment with respect to the rendering
> objects.
>
> The Collaboration Data Objects (CDO) 1.2.1 Rendering objects are not
> installed by or supported for use with
> Exchange Server 2003 or later.
>
> I've done numerous web searches but can't find a solution.
>
date: Mon, 26 Feb 2007 15:32:31 +1100
author: Glen Scales [MVP]
|
|