Microsoft KB Archive/270894

= OL2000: The GetFreeBusy Method Returns Incorrect Results =

Article ID: 270894

Article Last Modified on 9/29/2003

-

APPLIES TO


 * Microsoft Outlook 2000 Standard Edition

-



This article was previously published under Q270894



SYMPTOMS
The GetFreeBusy method incorrectly reports that one or more time slots are available, when the time slots should be marked as busy.



CAUSE
This problem occurs if you use an Interval parameter other than 1, 15, 30 or 60 minutes in length for the time slot. The GetFreeBusy method has a parameter that is named Interval. The Interval parameter requires a long integer and specifies the length of each time slot in minutes.



WORKAROUND
To work around this problem and receive the correct results, use the following function: Function GetAccurateFreeBusy(TargetRecip, StartDate, Interval) Dim strFB_1, strCorrectFB, i, n, blnBusyFlag On Error Resume Next strFB_1 = TargetRecip.AddressEntry.GetFreeBusy(StartDate, 1, Complete) If Err.Number <> 0 Then Exit Function End If  For i = 1 To Len(strFB_1) Step Interval blnBusyFlag = False For n = 0 To (Interval - 1) If Mid(strFB_1, i + n, 1) = &quot;1&quot; Then blnBusyFlag = True End If      Next If blnBusyFlag Then strCorrectFB = strCorrectFB & &quot;1&quot; Else strCorrectFB = strCorrectFB & &quot;0&quot; End If  Next GetAccurateFreeBusy = strCorrectFB End Function GetAccurateFreeBusy Function

The GetAccurateFreeBusy function returns a string that represents the availability of the recipient for a period of 30 days from the StartDate, which begins at midnight of the date specified.

GetAccurateFreeBusy (TargetRecip, StartDate, Interval)

Arguments

TargetRecip Required. Valid recipient object. If the TargetRecip is not a valid recipient, the GetAccurateFreeBusy returns a zero-length string.

StartDate Required. Valid date/time.

Interval Required. The Integer represents the number of minutes in each free/busy interval.

Remarks

The following example obtains the free/busy information by using a 90 minute interval: MyString = GetAccurateFreeBusy(Application.Session.CurrentUser, Date, 90)



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
