Sdílet prostřednictvím


Rendering Free-Busy Status to a Web Page (CDOEX)

Topic Last Modified: 2006-06-11

Example

VBScript

'Rendering free-busy status to a Web page with CDOEx
<!--
'Build Instructions:
'1) Create a folder named "test" under inetpub/wwwroot.
'2) Save the following file in that folder with the mentioned name.
'3)  Make the changes to the below file i.e. Change the UserName, DomainName, ServerName, strStartTime, strEndTime, iInterval variable to reflect your mailbox, domain and search criteria.
'4) Save the file.
'5) open internet service manager and browse to the "test"  folder
'6) right click and go to properties
'7) go to the "Directory Security" tab.
'8) Click on "Edit" button next to the "handshake" icon
'9) Uncheck "Anonymous Access"
'10) Uncheck "Anonymous access",  check the "Basic authentication", "Digest authentication", "Integrated Windows authentication"
'11) click ok
'12) click ok
'13) Load the asp in the browser.
 -->

<!--
<%@ Language=VBscript%>
<%
    Sub PrintStatus(strStatus)
   Select Case strStatus
   Case "0"   'Free
      Response.Write "<TD>Free</TD></TR>"
   Case "1"   'Tentative
      Response.Write "<TD>Tentative</TD></TR>"
   Case "2"   'Busy
      Response.Write "<TD>Busy</TD></TR>"
   Case "3"   'Out Of Office

      Response.Write "<TD>Out Of Office</TD></TR>"
   End Select
    End Sub

    UserName = "username"
    DomainName = "domain.fourthcoffee.com"
    ServerName = "servername"
    strStartTime = #1/20/2000 7:00:00 AM#
    strEndTime = #1/20/2000 11:00:00 AM#
    iInterval = 30

    Set iAddr = createobject("CDO.Addressee")
    iAddr.EmailAddress = UserName & "@" & DomainName
    iAddr.CheckName ("LDAP://" & ServerName)

    strFreebusy = iAddr.GetFreeBusy(strStartTime, strEndTime, iInterval)

    Response.Write "<Table Border =1>"
    For i = 1 To Len(strFreebusy)
   If i = 1 Then
      Response.Write "<TR><TD>Start Time</TD><TD>" & strStartTime & " ~ </TD>"
   Elseif i = len(strFreebusy) Then
      Response.Write "<TR><TD>End Time</TD><TD>" & strEndTime & " ~ </TD>"
   Else
      Response.Write "<TR><TD>.</TD><TD> + " & iInterval & " min ~ </TD>"
   End If
   Call PrintStatus(Mid(strFreebusy, i, 1))
    Response.Write "</TABLE>"
    Set iAddr = Nothing
%>
-->