How to book resources with OL2003/VBA +/- Redemption

G

Guest

Hello,

I'm hoping for some assistance with the following problem.
The inline documentation should be self-explanatory. I understand
that OL2007 allows for the Outlook model guard to be ignored
(see http://www.outlookcode.com/d/sec.htm) but I don't have
that luxury yet.

Thanks , Simon

'***********************************************************
Sub BookResources()
'***********************************************************
'Purpose is to book several resources programmatically using
'Redemption library (http://www.dimastr.com/redemption)
'to get around part of Outlook 'security 'model.
'Example code below only shows one resource being booked.
'
'Approach is to create an appointment item with Outlook object
'model, assign the item to a Redemption appointment item and
'send to the resource mailbox/
'
'Environment is XP Pro SP2 w/OL2003, Windows Server 2003
'w/Exchange Server 2003 and Redemption (4.2.0.562)
'
'Prerequisites are resource mailbox aliased as "Room Willow"
'created as a windows account with calendar options set to
'accept all meeting requests and author permissions granted
'to client account
'***********************************************************

'Declare variables
Dim oApp 'Outlook application instance
Dim oItm 'Outlook item object
Dim oRcp 'Outlook recipient object
Dim rApp As Object 'Redemption safe appointment item

'Set up error handling
On Error GoTo eh

'Instantiate outlook application
Set oApp = CreateObject("Outlook.Application")

'Create an outlook appointment item
Set oItm = oApp.CreateItem(olAppointmentItem)

'Define the item as a meeting and set other attributes
oItm.MeetingStatus = olMeeting
oItm.Subject = "Meeting Subject"
oItm.Location = "Meeting Location"
oItm.Start = DateSerial(2007, 6, 15)
oItm.Duration = 1000

'Add recipient
Set oRcp = oItm.Recipients.Add("Room Willow")
'[Note: this will trigger first level of Outlook security
'but you can grant this for 10 minutes which will allow you to book
'a number of resources in this time]

'Define recipient as a resource
oRcp.Type = olResource

'Create a Redemption safe appointment item
Set rApp = CreateObject("Redemption.SafeAppointmentItem")

'Assign the outlook item to the redemption once to circumvent
'Outlook's security blocks
rApp.Item = oItm

'Send meeting request
rApp.Send

'Clean up objects
Set oApp = Nothing
Set oItm = Nothing
Set oRcp = Nothing
Set rApp = Nothing

'Quit procedure
Exit Sub

'Error handler
eh:
MsgBox "Error : " & Err.Number & ", " & Err.Description

End Sub
 
D

Dmitry Streblechenko

The current version of Redemption does not do direct booking - with direct
booking enabled on a particular mailbox, Outlook directly creates a new
appointment in the resource mailbox without sending anything. This feature
is schedules for the next (4.4) version of Redemption.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Tadwick said:
Hello,

I'm hoping for some assistance with the following problem.
The inline documentation should be self-explanatory. I understand
that OL2007 allows for the Outlook model guard to be ignored
(see http://www.outlookcode.com/d/sec.htm) but I don't have
that luxury yet.

Thanks , Simon

'***********************************************************
Sub BookResources()
'***********************************************************
'Purpose is to book several resources programmatically using
'Redemption library (http://www.dimastr.com/redemption)
'to get around part of Outlook 'security 'model.
'Example code below only shows one resource being booked.
'
'Approach is to create an appointment item with Outlook object
'model, assign the item to a Redemption appointment item and
'send to the resource mailbox/
'
'Environment is XP Pro SP2 w/OL2003, Windows Server 2003
'w/Exchange Server 2003 and Redemption (4.2.0.562)
'
'Prerequisites are resource mailbox aliased as "Room Willow"
'created as a windows account with calendar options set to
'accept all meeting requests and author permissions granted
'to client account
'***********************************************************

'Declare variables
Dim oApp 'Outlook application instance
Dim oItm 'Outlook item object
Dim oRcp 'Outlook recipient object
Dim rApp As Object 'Redemption safe appointment item

'Set up error handling
On Error GoTo eh

'Instantiate outlook application
Set oApp = CreateObject("Outlook.Application")

'Create an outlook appointment item
Set oItm = oApp.CreateItem(olAppointmentItem)

'Define the item as a meeting and set other attributes
oItm.MeetingStatus = olMeeting
oItm.Subject = "Meeting Subject"
oItm.Location = "Meeting Location"
oItm.Start = DateSerial(2007, 6, 15)
oItm.Duration = 1000

'Add recipient
Set oRcp = oItm.Recipients.Add("Room Willow")
'[Note: this will trigger first level of Outlook security
'but you can grant this for 10 minutes which will allow you to book
'a number of resources in this time]

'Define recipient as a resource
oRcp.Type = olResource

'Create a Redemption safe appointment item
Set rApp = CreateObject("Redemption.SafeAppointmentItem")

'Assign the outlook item to the redemption once to circumvent
'Outlook's security blocks
rApp.Item = oItm

'Send meeting request
rApp.Send

'Clean up objects
Set oApp = Nothing
Set oItm = Nothing
Set oRcp = Nothing
Set rApp = Nothing

'Quit procedure
Exit Sub

'Error handler
eh:
MsgBox "Error : " & Err.Number & ", " & Err.Description

End Sub
 

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