OL2002: The GetFreeBusy Method Returns Incorrect Results (294554)



The information in this article applies to:

  • Microsoft Outlook 2002

This article was previously published under Q294554

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) = "1" Then
             blnBusyFlag = True
          End If
       Next
       If blnBusyFlag Then
          strCorrectFB = strCorrectFB & "1"
       Else
          strCorrectFB = strCorrectFB & "0"
       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

REFERENCES

For additional information about available resources and answersto commonly asked questions about Microsoft Outlook solutions, click the article number below to view the article in the Microsoft Knowledge Base:

287530 OL2002: Questions About Custom Forms and Outlook Solutions


Modification Type:MinorLast Reviewed:3/1/2004
Keywords:kbbug KB294554