I'm struggling to get FreeBusy to return correct information for the 12am to 1pm period. I have grabbed the code below from MS [ FreeBusy Method ] and made a few small changes to return just one day's worth of results at 30 minute intervals.
Public Sub GetFreeBusyInfo()
Dim myNameSpace As Outlook.NameSpace
Dim myRecipient As Outlook.Recipient
Dim myFBInfo As String
Set myNameSpace = Application.GetNamespace("MAPI")
Set myRecipient = myNameSpace.CreateRecipient("{email address}")
On Error GoTo ErrorHandler
myFBInfo = Mid(myRecipient.FreeBusy(#10/27/2016#, 30, True), 1, 48)
Debug.Print myFBInfo
Exit Sub
ErrorHandler:
MsgBox "Cannot access the information. "
End Sub
The problem is, no matter what meetings I have between 12am through 1pm on October 27, 2016 only zeros are returned. If I move a meeting to the afternoon then the correct number (1, 2, etc) depending on the tentative/busy/out status is returned correctly.
Does anyone know if there's a reason for this weird behaviour. About all I can think of is I'm GMT+13 (NZDT) creating a 13 hour 'bug' / blind spot somehow?
To illustrate. The output to the immediate window for this produces:
000000000000000000000000001033302200000000000000
12am______________________1pm__________________
The "Tentative" meeting at 1pm is the '1' and the "Out" meeting at 2pm is the three '3's. All meetings before 1pm are returning only zeros regardless of their status. Does anyone have any idea whether this is a bug or has a fix?
Public Sub GetFreeBusyInfo()
Dim myNameSpace As Outlook.NameSpace
Dim myRecipient As Outlook.Recipient
Dim myFBInfo As String
Set myNameSpace = Application.GetNamespace("MAPI")
Set myRecipient = myNameSpace.CreateRecipient("{email address}")
On Error GoTo ErrorHandler
myFBInfo = Mid(myRecipient.FreeBusy(#10/27/2016#, 30, True), 1, 48)
Debug.Print myFBInfo
Exit Sub
ErrorHandler:
MsgBox "Cannot access the information. "
End Sub
The problem is, no matter what meetings I have between 12am through 1pm on October 27, 2016 only zeros are returned. If I move a meeting to the afternoon then the correct number (1, 2, etc) depending on the tentative/busy/out status is returned correctly.
Does anyone know if there's a reason for this weird behaviour. About all I can think of is I'm GMT+13 (NZDT) creating a 13 hour 'bug' / blind spot somehow?
To illustrate. The output to the immediate window for this produces:
000000000000000000000000001033302200000000000000
12am______________________1pm__________________
The "Tentative" meeting at 1pm is the '1' and the "Out" meeting at 2pm is the three '3's. All meetings before 1pm are returning only zeros regardless of their status. Does anyone have any idea whether this is a bug or has a fix?
Last edited by a moderator: