Visual Basic.NET - Obtener outlook calendar desde una aplicacion web

 
Vista:
sin imagen de perfil

Obtener outlook calendar desde una aplicacion web

Publicado por Isis (1 intervención) el 16/07/2015 21:19:33
Hola a todos he creado un programa para obtener el calendario de outlook y para esto use Microsoft.Office.Interop.Outlook. El problema es que cuando lo ejecuto desde el servidor no funciona. Alguna idea de q puedo hacer para que funcione desde el servidor. Gracias

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Function SelectableDayOutlook(DateDisable As Date, IsSelectable As Boolean) As Boolean
        Dim HoursNeeded As String = lblHoursNeeded.Text + ":00"
        Dim HoursEndPrev As String = "09:00:00"
        Dim LastHour As String = "17:00:00"
        Dim Selectable = True
        Dim SubActual As String = ""
        Dim SubEnd As String = ""
        ' Create Outlook application.
        Dim oApp As Outlook.Application = New Outlook.Application()
        ' Get NameSpace and Logon.
        Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")
        oNS.Logon("isis@pdpflorida.com", "Miami12345!", False, True) ' TODO:
        ' Get Appointments collection from the Calendar folder.
        Dim oCalendar As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar)
        Dim oItems As Outlook.Items = oCalendar.Items
        For Each oAppt As Outlook.AppointmentItem In oItems
            If oAppt.Organizer = "Isis Villuendas" Then
                If oAppt.Start.Date = DateDisable.Date Then
                    SubActual = Subtract_Hours(HoursEndPrev, oAppt.Start.ToString("HH:mm:ss"))
                    SubEnd = Subtract_Hours(oAppt.End.ToString("HH:mm:ss"), LastHour)
 
                    If SubActual < HoursNeeded Or SubEnd < HoursNeeded Then
                        Selectable = False
                    ElseIf IsSelectable Then
                        InsertHoursNotAppDay(HoursEndPrev, LastHour)
                    End If
                    HoursEndPrev = oAppt.End.ToString("HH:mm:ss")
                ElseIf oAppt.Start.Date > DateDisable.Date And IsSelectable Then
                    InsertHoursNotAppDay("09:00:00", LastHour)
                    Exit For
                End If
            End If
        Next
        oNS.Logoff()
 
        ' Clean up.
        oApp = Nothing
        oNS = Nothing
        oItems = Nothing
        Return Selectable
End Function
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder