Help with FREEBUSY

C

callmedoug

well i thought I had this all figured out but I am running into a
couple problems.

a portion of the code I am running is attached.

I have 2 problems.

1. I don't want to create a new outlook object, I would rather get the
FREEBUSY on the AddressEntry variable. because the new outlook object
brings up a popup telling me that a program is trying to access my
address book, and I have to "allow" it. also when the program goes
through the list of meeting rooms, when they populate in my listbox,
and I choose one, it appears in the schedule as freebusy time not
available for some reason.

2. I want the start time in FREEBUSY to be the start time of the
meeting so I can grab the first number that FREEBUSY generates. It
seems that START is alway the beginning of the day. any way to make
this the start time of the meeting/

So anyway to use to make

myFBInfo = myRecipient.FreeBusy(MyStart, MyDur)

into

myFBInfo = AddressEntry.FreeBusy(MyStart, MyDur)

and make MyStart the beginning of the meeting time (not just the
date)??

Thanks in advance
Doug


-----code---------
Sub GetRooms()


Dim myolApp As Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myRecipient As Outlook.Recipient
Dim myFBInfo As String
Dim myAddressList As AddressList
Dim AddressEntry As AddressEntry
Dim MyStart
Dim MyDur


Set myAddressList = Application.Session.AddressLists("Global Address
List")
Set Meeting = Outlook.ActiveInspector.CurrentItem
Set myolApp = CreateObject("Outlook.Application")
Set myNameSpace = myolApp.GetNamespace("MAPI")
Set myRecipient = myNameSpace.CreateRecipient(AddressEntry.Name) '<---
rooms

MyStart = Meeting.Start
MyDur = Meeting.Duration

' go through address book and get each meeting room

For Each AddressEntry In myAddressList.AddressEntries
strRooms = LCase(AddressEntry.Name)

If Left(strRooms, 5) = "mtgrm" Then

If Mid(strRooms, 7, 3) = strCity Then
myFBInfo = myRecipient.FreeBusy(MyStart, MyDur)

If Left(myFBInfo, 1) = 0 Then
lbxRooms.AddItem AddressEntry.Name

End If

End If

End If

Next

End Sub
 
K

Ken Slovak - [MVP - Outlook]

From the Outlook Help:
"The GetFreeBusy method returns a String representing the availability of
the individual user for a period of 30 days from the start date, beginning
at midnight of the date specified."

A Recipient has an AddressEntry property. If you have an AddressEntry
already then just use that method.

You must parse the returned string, you're not going to be able to retrieve
it as you want it to be returned.
 
C

callmedoug

let me see if I understand,

are you saying I can use

myFBInfo = AddressEntry.FreeBusy(MyStart, MyDur) ????

or am I missing reading you?


What is the common way people use the FreeBusy, do I need to do a count
in from midnight to the start time of the scheduled time? is there
another more suitable way?

From the Outlook Help:
"The GetFreeBusy method returns a String representing the availability of
the individual user for a period of 30 days from the start date, beginning
at midnight of the date specified."

A Recipient has an AddressEntry property. If you have an AddressEntry
already then just use that method.

You must parse the returned string, you're not going to be able to retrieve
it as you want it to be returned.


myFBInfo = myRecipient.FreeBusy(MyStart, MyDur)
 
K

Ken Slovak - [MVP - Outlook]

The method for AddressEntry is GetFreeBusy. Use F2 to display the Object
Browser, it shows every method and property and event for every item. It's
the best resource to use to learn about what's available to you.

You must start at midnight and parse the returned string to get to your
desired starting point. You can use the arguments to the GetFreeBusy method
to set how much detail you want to get back.
 
C

callmedoug

Hi Ken,

it was the "Get" in front of freebusy that was throwing me off, it is
now working great.

Now just to figure out the best way to parse into the getfreebusy
return to find the range i need....

thanks for pointing me in the right direction
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top