2015-01-28 3 views
0

이미 배포 목록에 각 자원의 배열이 있습니다. 배열의 각 리소스가 사용자가 요청한 시작 및 종료 시간 동안 Exchange 서버를 통해 사용할 수 있는지 확인하려면 어떻게합니까? 이것은 리본에 outlook addin 될 것입니다.Exchange를 통해 선택한 날짜 동안 자원을 사용할 수 있는지 확인하십시오.

Public Sub AddElementToStringArray(ByVal stringToAdd As String) 
    ReDim Preserve distArray(distArrayElements) 
    distArray(distArrayElements) = stringToAdd 
    distArrayElements += 1 
End Sub 

Dim startDate As Date 
Dim endDate As Date 

Sub checkAvailable() 

    'distArray declared earlier. 
    If distArray Is Nothing Then 
     Exit Sub 
    Else 
     'Check if they are available. 
     'if available, add to resourceListBox. 
    End If 

End Sub 
+1

참조 제안 : http://stackoverflow.com/questions/5622477/vba-outlook-seeing-peoples-calendars 나는 화면에 일정을 표시하지 않으려는 –

+0

,이 원하는 모든 일은 백그라운드에서 일어납니다. 나는 내가 가진 배열을 가져 가고 싶다. 이것은 배포 목록의 자원이며 시작일과 종료일 동안 사용할 수 있다면 루프마다 하나씩 검사한다. 그러면 목록 상자에 표시됩니다. – Jason

+0

Outlook 클라이언트를 통해 또는 서버와 직접 연결하기를 원하십니까? 어쩌면 작업중인 환경을 추가 할 수도 있습니다 (Excel? Outlook?) –

답변

1
Public Sub GetFreeBusyInfo() 
    Dim myOlApp As New Outlook.Application 
    Dim myNameSpace As Outlook.NameSpace 
    Dim myRecipient As Outlook.Recipient 
    Dim myFBInfo As String 
    Set myNameSpace = myOlApp.GetNamespace("MAPI") 
    Set myRecipient = myNameSpace.CreateRecipient("Nate Sun") 
    On Error GoTo ErrorHandler 
    myFBInfo = myRecipient.FreeBusy(#11/11/2003#, 60 * 24) 
    MsgBox myFBInfo 
    Exit Sub 
ErrorHandler:  
    MsgBox "Cannot access the information. " 
End Sub 
여기
관련 문제