Problem with FreeBusy (before 1pm only)

Status
Not open for further replies.

kennyp

New Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
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:
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-File-Options-Calendar-TimeZones.jpg
    Outlook-File-Options-Calendar-TimeZones.jpg
    14.4 KB · Views: 676
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...
 
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.
 
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.
 
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
 
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
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Victor_50 Problem - Google Workspace will stop "unsafe" access to Outlook end 2024 Using Outlook 3
Geldner Problem submitting SPAM using Outlook VBA Form Outlook VBA and Custom Forms 2
A Online Mode to Cached Exchange Mode problem Using Outlook 2
S Problem Accessing .MSG Property 'ImageNaturalHeight' Tag '0x80010003' Outlook VBA and Custom Forms 1
T Problem when requesting to view an email in a browser Using Outlook 0
R Outlook 2021 Having problem setting up outlook 2021 with windows 11. I have 3 gmail accounts and I want the 3 gmail, emails to merge into the same outlook input. Using Outlook.com accounts in Outlook 0
e_a_g_l_e_p_i Is anyone else having problem conneccting to gmail? Using Outlook 27
P Outlook calendar and contacts sync problem-outlook disconnects Using Outlook.com accounts in Outlook 2
S Archiving and Likely Modified Date Problem Using Outlook 3
R Problem moving file “Email folders.pst” to new PC Using Outlook 5
S Problem Checking the available stores in my Inbox (Outlook VBA) Outlook VBA and Custom Forms 0
Witzker GetAssignedView Problem Outlook VBA and Custom Forms 2
M Outlook 2010 Problem with OutLook 2010 32 bit, after Windows Auto Update Using Outlook 3
Marc2019 Outlook 2016 Font Problem Using Outlook 5
X I have met my waterloo trying to resolve embedded graphics problem with outlook 2007 and now 2016 Using Outlook 1
D Problem with custom form including _DocSiteControl1 Outlook VBA and Custom Forms 0
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 4
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 0
D Sort Problem with Sent Folders Using Outlook 1
S Conditional formatting problem with "is not empty" and categories Using Outlook 2
Mark Foley The upload of "Calendar" failed. There was a problem with the request. Using Outlook 6
avant-guvnor Import csv problem Using Outlook 7
katehawkins Outlook 2013 Ost to pst conversion problem Using Outlook 1
AbbieWhite The problem with a fairly large file. Using Outlook 3
I Outlook 2013 Send problem - 'Not Responding' forever Using Outlook.com accounts in Outlook 10
EmelineGueguen Help to understand the problem of work Using Outlook 1
W Outlook 2016 search problem persists after applying all known solutions Using Outlook 12
S problem with convert Using Outlook 1
S SendFromAccount - Problem trying to test existing value in open email Outlook VBA and Custom Forms 2
DruinaBiscardi unexpected problem in outlook Using Outlook 1
V Outlook 2003 problem with Windows 10 Creators Update 1709 Using Outlook 0
G Windows Update Causes BCM Database Access Problem? BCM (Business Contact Manager) 4
Grimev66 problem with conversion ost to pst Using Outlook 2
R Problem with searching public folders Exchange 2013/16 Exchange Server Administration 2
J Problem with Outlook 2016 new mail tray icon alert (envelope in the systems tray) Using Outlook.com accounts in Outlook 0
S Problem running Command button code Outlook VBA and Custom Forms 2
A .ost file problem Using Outlook 4
G PROBLEM REGARDING OUTLOOK STORAGE LANGUAGES Using Outlook 4
PetraTech Odd Folder View Problem Using Outlook 3
V iCloud problem Using Outlook 9
D Reply Problem with Outlook.com account Using Outlook.com accounts in Outlook 0
MattC Problem with Outlook 2007 & iCloud / duplicate tasks Using Outlook 1
V Problem moving folders Using Outlook 4
C Problem tracking meeting responses Using Outlook 3
Mark Foley Problem subscribing to shared calendar Using Outlook 1
skylark53 Advanced recurrence problem Using Outlook 2
E RSS export as OPML problem Using Outlook 4
D outlook 2013 contact list problem Using Outlook 0
T Problem with .Recipients.Add("alias") Outlook VBA and Custom Forms 3
P Problem with Outlook 2013 Attachments Using Outlook 4

Similar threads

Back
Top