A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Help with FREEBUSY



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 1st 06, 11:14 PM posted to microsoft.public.outlook.program_vba
callmedoug
external usenet poster
 
Posts: 13
Default 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

  #2  
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


  #3  
Old December 2nd 06, 02:44 AM posted to microsoft.public.outlook.program_vba
callmedoug
external usenet poster
 
Posts: 13
Default 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)

  #4  
Old December 4th 06, 05:50 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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?


  #5  
Old December 4th 06, 08:06 PM posted to microsoft.public.outlook.program_vba
callmedoug
external usenet poster
 
Posts: 13
Default 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?


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:30 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-2025 Outlook Banter.
The comments are property of their posters.