Avatar billede morten_linder Praktikant
24. august 2001 - 12:57 Der er 2 kommentarer og
1 løsning

Trække oplysninger ud fra exchange....

Hej.

Vi har en Exchange 2000 server kørende, og ønsker nu, at lave en samlet kalender for en distributionsliste...

Jeg har fundet noget kode hos MicroBlød..
men, kan ikke lige få det til at gøre som jeg vil..
jeg poster koden her og linket til MS.. nogen som måske kan gennemskue hvad jeg gør forkert.

Morten

<%@ LANGUAGE=\"VBSCRIPT\" %>
  <HTML>
  <HEAD>
  <TITLE>Free Busy Information</TITLE>
  </HEAD>
  <BODY>
  <TABLE ALIGN=RIGHT BORDER>
  <TH>Status<TH>Color
  <TR><TD>Free<TD bgcolor=white>&nbsp</TR>
  <TR><TD>Tenative<TD bgcolor=lightblue>&nbsp</TR>
  <TR><TD>Busy<TD bgcolor=blue>&nbsp</TR>
  <TR><TD>Out-of-Office<TD bgcolor=purple>&nbsp</TR>
  </TABLE>
  <P>
  <%

  On Error Resume Next
  Const cdoDistList = 1
    Dim objSession
    Dim strProfileInfo
    strProfileInfo = \"MAILSRV01\" & vbLF & \"mlp\"

    Set objSession = CreateObject(\"MAPI.Session\")
    objSession.Logon , , False, True, 0, True, strProfileInfo

    Set objMessage = objSession.Outbox.Messages.Add
    Set objRecips = objMessage.Recipients

    \' Add the users or Distribution lists that you would like to
    \' see free/busy information.
    objRecips.Add(\"mlp\")
    objRecips.Add(\"cja\")
    objRecips.Add(\"DL Ripe\")


  For Each r In objRecips
      \' If it is a distribution list, do the following.
      If r.AddressEntry.DisplayType = cdoDistList Then

        \' Get the individual members, and add them.
        Set objMembers = r.AddressEntry.members
        For Each mem In objMembers
          objRecips.Add(mem.name)
        Next

        \' Remove the distribution list from the recipients\' collection.
        r.delete
      End If
  Next

  objRecips.Resolve
  Response.Write( \"<TABLE border align=center>\" & vbLF _
                      & \"<TR><TH>Name\" )

  \' Create the column headers.
  For j = 0 To 23
      temp = j Mod 12
      If temp = 0 Then temp= 12
      Response.Write(\"<TH>\" & temp)
  Next
  For Each r In objRecips
  Response.Write( \"<TR><TD>\" & r.name )

      \' When checking the free/busy information, pass in the start
      \' date/time, end date/time, and interval in minutes.

      \' Get Today\'s date.
      objDate1= Date()

      \' Get Tommorow\'s date.
      objDate2= Date() + 1

      \' Retrieve the Free/Busy Information from between to two
      \' time periods.

      \' If the user does not have any appointments
      \' on their calendar GetFreeBusy will return in error.
      \' This error check creates a string of zeros
      \' representing availability.
      FreeBusyInfo =r.GetFreeBusy(objDate1,objDate2,60)
      If Err Then  \'<< The only line that is changed.
        FreeBusyInfo = String(24,\"0\")
        Err.Clear
      End If

      \' Look at each of the time blocks returned and decide what the
      \' status is. Each segement will be a table cell.
      For i = 1 To Len(FreeBusyInfo)

        \' If the person is available leave the color white.
        \' If the person is tenative set to the color to light blue.
        \' If the person has a commitment set the color to blue.
        \' If the person is oof set the color to purple.

        Select Case Mid(FreeBusyInfo, i, 1)

          Case \"0\"
              Response.Write( \"<TD bgcolor=white>&nbsp\" )

          Case \"1\"
              Response.Write( \"<TD bgcolor=lightblue>&nbsp\" )

          Case \"2\"
              Response.Write( \"<TD bgcolor=blue>&nbsp\" )

          Case \"3\"
              Response.Write( \"<TD bgcolor=purple>&nbsp\" )

        End Select

      Next
      \' End of 1 person\'s data.

      Response.Write( \"</TR>\" )
  Next

  Set objMessage = Nothing
  objSession.Logoff
  Set objSession = Nothing
  %>

  </BODY>
  </HTML>

http://support.microsoft.com/support/kb/articles/q195/5/91.asp

Avatar billede morten_linder Praktikant
06. september 2001 - 13:09 #1
ja ja
Avatar billede horsmark Nybegynder
07. februar 2002 - 21:58 #2
Hej Morten har du fået løst problemet ?

Jeg sidder i selv samme prob nu nemmerlig :-)

mvh
HorsMark
Avatar billede morten_linder Praktikant
08. november 2002 - 09:34 #3
nope :(
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester