通过交换检查选定日期内资源是否可用

Check if resource is available during selected dates via exchange

分发列表中的每个资源我都已经有了一个数组。在用户请求的开始和结束时间期间,如何通过交换服务器检查数组中的每个资源是否可用?这将是功能区上的 Outlook 插件。

 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
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