Reputation: 165
I would like to automatically run a macro when an appointment is updated.
For my test, I wish this macro displays the subject of the appointment.
Upvotes: 0
Views: 1473
Reputation: 9199
You want the ItemChange event http://msdn.microsoft.com/en-us/library/office/ff865866%28v=office.14%29.aspx
Public WithEvents myOlItems As Outlook.Items
Public Sub Application_Startup()
Set myOlItems = _
Application.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items
End Sub
Private Sub myOlItems_ItemChange(ByVal Item As Object)
debug.print item.subject
End Sub
Upvotes: 1
Reputation: 1144
This can be done by creating a rule in Outlook, and will start a macro. If you have your macro working right, then you need only set the rule. First:
Sub Sub_name(MyMail As MailItem)
'Working Code
End Sub
Then, set the condition to "which is a meeting invitation or update", actions are "run a script" Check on it, then click on the "script" link and select Sub_name.
Upvotes: 0