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
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