View Single Post
  #1  
Old December 1st 06, 11:28 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Help with FREEBUSY

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"callmedoug" wrote in message
ups.com...
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


Ads