FreeBusy Method

Microsoft Outlook Visual Basic

FreeBusy Method

       

Returns free/busy information for the recipient. The default is to return a string representing one month of free/busy information compatible with the Microsoft Schedule+ Automation format (that is, the string contains one character for each MinPerChar minute, up to one month of information from the specified Start date).

If the optional argument CompleteFormat is omitted or False, then "free" is indicated by the character 0 and all other states by the character 1.

If CompleteFormat is True, then the same length string is returned as defined above, but the characters now correspond to the OlBusyStatus constants: olBusy, olFree, olOutOfOffice, or olTentative.

expression.FreeBusy(Start, MinPerChar, CompleteFormat)

expression   Required. An expression that returns a Recipient object.

Start   Required Date. The start date for the returned period of free/busy information.

MinPerChar   Required Long. The number of minutes per character represented in the returned free/busy string.

CompleteFormat   Optional Variant. True if the returned string should contain not only free/busy information, but also values for each character according to the OlBusyStatus constants: olBusy, olFree, olOutOfOffice, and olTentative.

Example

This Visual Basic for Applications example uses the FreeBusy method to return a string of free/busy information with one character for each day. This example allows for the possibility that the free/busy information for this recipient is not accessible.

Public Sub cmdCreate_Click()
    Set myOlApp = CreateObject("Outlook.Application")
    Set myNameSpace = myOlApp.GetNameSpace("MAPI")
    Set myRecipient = myNameSpace.CreateRecipient("Paul Borm")
    On Error GoTo ErrorHandler
    myFBInfo = myRecipient.FreeBusy(#8/1/97#, 60 * 24)
    Exit Sub
    ErrorHandler: MsgBox "Cannot access information. "
End Sub

This Visual Basic for Applications example returns a string of free/busy information with one character for each hour (complete format).

Set myRecipient = myNameSpace.CreateRecipient("Kevin Yim")
myFBInfo = myRecipient.FreeBusy(#8/1/97#, 60, True)