ReminderFire event to change task olimportance

Joined
May 18, 2009
Messages
4
Reaction score
0
Hi,
i'm trying to write a macro on thisoutlooksession to trap ReminderFire event to change the task olimportance (only for the task that fire) from normal to high...

something like

'<<ThisOutlookSession>>
Dim WithEvents ReminderFire As Outlook.Reminders

Private Sub objReminders_ReminderFire(ByVal ReminderObject As Reminder)
task.Importance = olImportanceHigh
task.Save
End Sub


but nothing appened. I try several other methods but with no result.
 
i found one working by myself



Public WithEvents objReminders As Outlook.Reminders
Sub Initialize_handler()
Set objReminders = Application.Reminders
End Sub
Private Sub objReminders_ReminderFire(ByVal ReminderObject As Reminder)
'Opens the item when a reminder executes
ReminderObject.Item.Display
ReminderObject.Item.Importance = 2


End Sub


Now i have the "problem" to close the reminder and save the task. Any suggestion to automatize ?
 
ok everything works

Public WithEvents objReminders As Outlook.Reminders
Sub Initialize_handler()
Set objReminders = Application.Reminders
End Sub
Private Sub objReminders_ReminderFire(ByVal ReminderObject As Reminder)
Dim objRems As Outlook.Reminders
Dim objRem As Outlook.Reminder
Dim i As Integer

'Apre l'attività
ReminderObject.Item.Display
ReminderObject.Item.Importance = 2

'Elimina il promemoria attivo.
Set objRems = Application.Reminders

For i = objRems.Count To 1 Step -1
If objRems(i).IsVisible = True Then
objRems(i).Dismiss
End If
Next
Set olApp = Nothing
Set objRems = Nothing
Set objRem = Nothing

'Salva le nuove impostazioni
ReminderObject.Item.Save

'Chiude l'attività
ReminderObject.Item.Close (SaveMode)



End Sub


now i have only to learn how to start this macro automatically because when i close and re-open outlook i need to restart the macro by press "play" on visual basic editor
 
Back
Top