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