A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Email triggered by Reminder



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 21st 06, 11:10 PM posted to microsoft.public.outlook.program_vba
john
external usenet poster
 
Posts: 1
Default Email triggered by Reminder

I'm getting an error on this Code Line of the 1st case:
objMsg.To = Item.To

I want to be able to email all those Scehduled for a meeting off the
reminder notice. It works if I give it an Email string, it just will not
return the original To. If it does not store them, is there a work around to
get them.


Private Sub Application_Reminder(ByVal Item As Object)
Dim objMsg As MailItem
' create new outgoing message
Set objMsg = Application.CreateItem(olMailItem)

' your reminder notification address
objMsg.Subject = "Reminder: " & Item.Subject
' must handle all 4 types of items that can generate reminders
Select Case Item.Class
Case olAppointment '26

objMsg.To = Item.To

objMsg.Body = _
"Start: " & Item.Start & vbCrLf & _
"End: " & Item.End & vbCrLf & _
"Location: " & Item.Location & vbCrLf & _
"Details: " & vbCrLf & Item.Body
Case olContact '40
objMsg.Body = _
"Contact: " & Item.FullName & vbCrLf & _
"Phone: " & Item.BusinessTelephoneNumber & vbCrLf & _
"Contact Details: " & vbCrLf & Item.Body
Case olMail '43
objMsg.Body = _
"Due: " & Item.FlagDueBy & vbCrLf & _
"Details: " & vbCrLf & Item.Body
Case olTask '48
objMsg.Body = _
"Start: " & Item.StartDate & vbCrLf & _
"End: " & Item.DueDate & vbCrLf & _
"Details: " & vbCrLf & Item.Body
End Select
' send the message
objMsg.Send
Set objMsg = Nothing
End Sub


  #2  
Old September 25th 06, 08:01 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Email triggered by Reminder

You can't use Item.To because the passed item object could be an Appointment,
Task, Contact or Mail Item - whatever the reminder was set on. Only MailItem
supports a To property.

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"john" wrote:

I'm getting an error on this Code Line of the 1st case:
objMsg.To = Item.To

I want to be able to email all those Scehduled for a meeting off the
reminder notice. It works if I give it an Email string, it just will not
return the original To. If it does not store them, is there a work around to
get them.


Private Sub Application_Reminder(ByVal Item As Object)
Dim objMsg As MailItem
' create new outgoing message
Set objMsg = Application.CreateItem(olMailItem)

' your reminder notification address
objMsg.Subject = "Reminder: " & Item.Subject
' must handle all 4 types of items that can generate reminders
Select Case Item.Class
Case olAppointment '26

objMsg.To = Item.To

objMsg.Body = _
"Start: " & Item.Start & vbCrLf & _
"End: " & Item.End & vbCrLf & _
"Location: " & Item.Location & vbCrLf & _
"Details: " & vbCrLf & Item.Body
Case olContact '40
objMsg.Body = _
"Contact: " & Item.FullName & vbCrLf & _
"Phone: " & Item.BusinessTelephoneNumber & vbCrLf & _
"Contact Details: " & vbCrLf & Item.Body
Case olMail '43
objMsg.Body = _
"Due: " & Item.FlagDueBy & vbCrLf & _
"Details: " & vbCrLf & Item.Body
Case olTask '48
objMsg.Body = _
"Start: " & Item.StartDate & vbCrLf & _
"End: " & Item.DueDate & vbCrLf & _
"Details: " & vbCrLf & Item.Body
End Select
' send the message
objMsg.Send
Set objMsg = Nothing
End Sub



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which event is triggered when user saves email item? Kasper Add-ins for Outlook 4 September 22nd 06 03:26 PM
Can I get Outlook 2003 to send an email triggered by an event Greg Wardlaw Outlook - Calandaring 1 September 1st 06 03:23 PM
read event not triggered Willem Peper Outlook and VBA 1 June 13th 06 07:03 AM
Email appointment reminder Josh Prowse Outlook - General Queries 2 March 17th 06 03:03 AM
Events not always triggered Jim Burke in Novi Outlook and VBA 1 January 30th 06 07:36 AM


All times are GMT +1. The time now is 07:10 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.