Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Scheduling Meetings using Free Busy data 2

Status
Not open for further replies.

TimK01

Technical User
Jan 4, 2002
94
I want to programaticly schedule meetings into groups of peoples calendars at a time when they are all free.

My approach was to try and look at their free busy data as we do manualy when we schedule, but using the Outlook object model in VB6 im not getting very far.

I can schedule the meetings and I can send confirmation messages but I cant "see" their calenders so I end up double booking people.

Can anyone offer any hints or assistance.

Thx Tim
 
I think this will be the 'rock and hard place' situation unless the users all 'share' their calendars as a master planning tool.

At best, without a shared calendar, you will need to do a lot of work and have permission to read each individuals' calendars as well as have to rely on them to keep their individual calendars up to date.




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
You need Outlook to be installed in Corporate/Workgroup mode and connecting to Exchange Server.

Each user's free/busy info is stored in a hidden public folder on Exchange Server. This is replicated to other Exchange Servers to provide availability across the organization.

There are two methods depending on whether you are starting with a Recipient or AddressEntry object for the user:

Recipient - FreeBusy
AddressEntry - GetFreeBusy

Both methods return a string containing 1 month's free/busy info. The MinPerChar/Interval parameter defines how many minutes are represented by each character. The CompleteFormat parameter determines if the string contains 0 for each free interval and 1 for any non-available interval or if will show the availability type:

0 olFree
1 olTentative
2 olBusy
3 olOutOfOffice.

Suppose a user has a 2 hour appointment at 9:00 am and is out of office at 4:00 pm. A call to FreeBusy with MinPerChar = 30 would return the a string starting with the following 48 chars representing 24 hours:

00000000000000000022220000000000333333333333333333

This example, using a 60 minute interval, checks if a user is available at 2:00 pm on 28-May for 2 hours:

Dim objRecip As Outlook.Recipient
Dim strFreeBusy As String

Set objOLApp = CreateObject("Outlook.Application")
Set objOLNS = objOLApp.GetNamespace("MAPI")
Set objRecip = objOLNS.CreateRecipient("Bloggs", "Fred")
objRecip.Resolve
strFreeBusy = objRecip.FreeBusy(#5/28/2003#, 60, True)
'Check the 14th & 15th chars for availability
If Clng(Mid$(strFreeBusy, 14, 2)) = olFree Then
'Joe Bloggs is free
Else
'Joe Bloggs is busy
End If

Set objRecip = Nothing
Set objOLNS = Nothing
Set objOLApp = Nothing

Note that when a user creates an appointment in Outlook, the free/busy info on Exchange is updated according to the setting in Tools | Options | Calendar Options | Free/Busy Options. Default is publish two months of free/busy info, updated to Exchange every 15 mins.

Paul Bent
Northwind IT Systems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top