Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Help with FREEBUSY (http://www.outlookbanter.com/outlook-vba/34357-help-freebusy.html)

callmedoug December 1st 06 11:14 PM

Help with FREEBUSY
 
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


Ken Slovak - [MVP - Outlook] December 1st 06 11:28 PM

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



callmedoug December 2nd 06 02:44 AM

Help with FREEBUSY
 
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?


Ken Slovak - [MVP - Outlook] wrote:
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



myFBInfo = myRecipient.FreeBusy(MyStart, MyDur)


Ken Slovak - [MVP - Outlook] December 4th 06 05:50 PM

Help with FREEBUSY
 
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.

--
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...
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?



callmedoug December 4th 06 08:06 PM

Help with FREEBUSY
 
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


Ken Slovak - [MVP - Outlook] wrote:
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.

--
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...
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?




All times are GMT +1. The time now is 08:25 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com