Outlook 2013 Problem with FreeBusy (before 1pm only)

Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server 2010
#1
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?
 
Last edited by a moderator:
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server 2010
#3
I'll check a similar macro i have - it does 5 min intervals and I don't recall any blind spots, but it's been awhile since i last tested it.
Thanks Diane, the time zone is definitely the cause of the failure. I changed my calendar options temporarily to UTC (file-Options-Calendar-TimeZones). Now when the function is run it returns the correct information for that "day". I'm amazed that nobody who lives in a time zone >+1UTC has not found this problem before. I can probably work around it by programatically changing the time zone, checking the free busy status and then, turning the time zone back, but that seems like an extreme workaround.
 

Attachments

Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server 2010
#4
Looks like I presumed too much - seems there is no way to programatically apply "swap time zones" so I'm back to square one with my original problem...
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#5
Thanks for the update - I'll pass it along to support. My tests (appeared) to work so i figured it was the zone but didn't have time to verify - now I'm wondering if all zones are affected, but at different ends of the day.
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#6
I have a workaround - try starting the day before and using mid to get the correct date. (Working with times is going to drive me to drink. :))

Outlook: UTC time zone, half hour appointments every hour. 12 & 1 (both AM & PM) are OOF, 3 A/P is Tentative. Others are busy. on the 24th, i have the noon-3 appt as well.
Using this code:
Code:
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("dianep")
On Error GoTo ErrorHandler
myFBInfo = Mid(myRecipient.freebusy(#11/22/2015#, 60, True), 1, 48)
Debug.Print "Nov 22 " & myFBInfo
myFBInfo = Mid(myRecipient.freebusy(#11/23/2015#, 60, True), 1, 48)
Debug.Print "Nov 23 " & myFBInfo
myFBInfo = Mid(myRecipient.freebusy(#11/24/2015#, 60, True), 1, 48)
Debug.Print "Nov 24 " & myFBInfo

Exit Sub
ErrorHandler:
MsgBox "Cannot access the information. "
End Sub
Days split at | (assuming I counted right :))
Coordinated Universal Time:
Nov 22 000000000000000000000000 | 331222222222331222222222
Nov 23 331222222222331222222222 | 000000000000331000000000
Nov 24 000000000000331000000000 | 000000000000000000000000

Eastern Standard Time
Nov 22 000000000000000000033122 | 222222233122222222200000
Nov 23 2222222331222222222000 | 00000000033100000000000000
Nov 24 000000033100000000000000 | 000000000000000000000000

New Zealand Standard Time
Nov 22 0000000000000000000000 | 00000000000000033122222222
Nov 23 0000000000000331222222 | 22233122222222200000000000
Nov 24 000000000000000000000000| 033100000000000000000000


if i use myFBInfo = Mid(myRecipient.freebusy((#11/23/2015#, 60, True), 25, 48), i get the correct values for the 24th (and 25th):
233122222222200000000000033100000000000000000000

As long as you know how many periods to move ahead, you'll get the correct value.
 

Prash_syd

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server
#7
I have a workaround - try starting the day before and using mid to get the correct date. (Working with times is going to drive me to drink. :))

Outlook: UTC time zone, half hour appointments every hour. 12 & 1 (both AM & PM) are OOF, 3 A/P is Tentative. Others are busy. on the 24th, i have the noon-3 appt as well.
Using this code:
Code:
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("dianep")
On Error GoTo ErrorHandler
myFBInfo = Mid(myRecipient.freebusy(#11/22/2015#, 60, True), 1, 48)
Debug.Print "Nov 22 " & myFBInfo
myFBInfo = Mid(myRecipient.freebusy(#11/23/2015#, 60, True), 1, 48)
Debug.Print "Nov 23 " & myFBInfo
myFBInfo = Mid(myRecipient.freebusy(#11/24/2015#, 60, True), 1, 48)
Debug.Print "Nov 24 " & myFBInfo

Exit Sub
ErrorHandler:
MsgBox "Cannot access the information. "
End Sub
Days split at | (assuming I counted right :))
Coordinated Universal Time:
Nov 22 000000000000000000000000 | 331222222222331222222222
Nov 23 331222222222331222222222 | 000000000000331000000000
Nov 24 000000000000331000000000 | 000000000000000000000000

Eastern Standard Time
Nov 22 000000000000000000033122 | 222222233122222222200000
Nov 23 2222222331222222222000 | 00000000033100000000000000
Nov 24 000000033100000000000000 | 000000000000000000000000

New Zealand Standard Time
Nov 22 0000000000000000000000 | 00000000000000033122222222
Nov 23 0000000000000331222222 | 22233122222222200000000000
Nov 24 000000000000000000000000| 033100000000000000000000


if i use myFBInfo = Mid(myRecipient.freebusy((#11/23/2015#, 60, True), 25, 48), i get the correct values for the 24th (and 25th):
233122222222200000000000033100000000000000000000

As long as you know how many periods to move ahead, you'll get the correct value.


hi,

My 2 cents....
"Freebusy function return string starts at 12:00 am of the day in datetime parameter regardless of the date parameter mentioned as the method ignores the time part. so getting the substring of 0,1 will always give you the status as of the first increment beginning at midnight. to figure out the the status of a person(or room) is at two pm in the afternoon, you need to traverse the return string by your given increment in steps until you arrive at the corresponding character.
Hope it Helps. I had to jump through a lot of hoops to understand this!
Regards,
guru
 

Prash_syd

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server
#8
Looks like I presumed too much - seems there is no way to programatically apply "swap time zones" so I'm back to square one with my original problem...

Hi,

My 2 cents....
"Freebusy function return string starts at 12:00 am of the day in datetime parameter regardless of the date parameter mentioned as the method ignores the time part. so getting the substring of 0,1 will always give you the status as of the first increment beginning at midnight. to figure out the the status of a person(or room) is at two pm in the afternoon, you need to traverse the return string by your given increment in steps until you arrive at the corresponding character.
Hope it Helps. I had to jump through a lot of hoops to understand this!

Regards,
guru
 

Similar threads

Top