Change properties of selected appointment

D

dim4x4

Hi!

I'm trying to just change "Duration" and "Reminder" properties of
selected appointment. Start time should reman the same (as when
selected). In the macro below it says "Type mismatch". Could anyone
help? Thx!

Sub ChangeProperties()

Dim objAppt As Outlook.AppointmentItem

Set objAppt =
Outlook.Application.ActiveExplorer.Selection

With objAppt
.Duration = 120 ' 2 hours
.ReminderMinutesBeforeStart = 60 ' 1 hour
End With

Set objAppt = Nothing

End Sub
 
M

Michael Bauer

Am 23 May 2006 03:44:25 -0700 schrieb dim4x4:

The Selection object is a collection of selected items. For a particular
item you need to call the Selection.Item property.
 
D

dim4x4

Should be simple, but can't figure it out. this doesn't work either.
(I'm trying to select 2 appointments and see if properties will
change).

Sub ChangeProperties()

Dim objOL As Outlook.Application
Dim objSelection As Outlook.Selection
Dim objAppt As Outlook.AppointmentItem

Set objOL = CreateObject("Outlook.Application")
Set objSelection = objOL.ActiveExplorer.Selection

For Each objAppt In objSelection
objAppt.Duration = 120 ' 2 hours
objAppt.ReminderMinutesBeforeStart = 60 ' 1 hour
Next

End Sub
 
M

Michael Bauer

Am 23 May 2006 05:08:56 -0700 schrieb dim4x4:

Simply call the Save method for each object after the changes are done.
 

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