PDA

View Full Version : Outlook appointment - notification when saved by user



coldpaws
01-23-2012, 09:13 AM
Dear Coders , first post here and your assistance would be greatly appreciated.

I'm preparing a email flyer to send around my organsiation in Outlook 2007 . I've attached an Icalendar .ics file to the email to allow users to quickly add the appointment to their own calendars ( I don't have a common server to host the ical file so can't use a link in the email to directly allow users to access the file). The Ical file is created by simply saving a calendar appointment as ics file format.
When the user opens the appointment from the email it's a standard outlook appointment format with all the details of the event.
What I want to do is to embed some VBA in the ics file so that if the user saves the appointment to their calendar it emails me from their account to identify who is interested.

I have code to do the emailing which works fine but I cannot get it to activate in the event of a user saving the appointment to their calendar.
I was looking for some form of 'On Save' type method but no luck.

Code sending the notification which runs fine though the debugger is:


Sub sendnotify()
Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)
objMail.BodyFormat = olFormatPlain
objMail.Subject = "User has saved appointment"
objMail.Body = "Contact user to confirm attendance"
objMail.To = "notify@nonsense.com" ' dummy email
objMail.Send
End Sub

I want this code to run when the user clicks on the 'Save & Close' button of the appointment.
Any ideas?
Thanks

JP2112
01-23-2012, 01:15 PM
There are already built-in tools to do what you want. What I would do is simply send out a standard meeting request and attach the flyer. The recipients click "Accept" or "Decline" and you get your response automatically. Outlook already knows how to handle the responses so you can open the "meeting" request and see who has accepted.

coldpaws
01-24-2012, 04:38 AM
Thanks JP ,
I know about the standard functionality and was perhaps trying to be too clever . Simple may be the way to go.