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

时间:2015-01-28 16:38:02

标签: vba loops exchange-server

我已在分发列表中拥有每个资源的数组。如何在用户请求的开始和结束时间内通过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 个答案:

答案 0 :(得分: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