![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I am looking for simple code that would send an email with the same
attachment and subject and recipient everytime I close down Outlook 2003. I did this once before on my old machine, and do not have the code any longer. Thanks! |
Ads |
#2
|
|||
|
|||
![]() Please search for 'Explorer wrapper'. With that you're able to track when the last Explorer is going to close, that's the time for your e-mail. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Organize eMails: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Mon, 23 Jul 2007 13:56:01 -0700 schrieb Mike: I am looking for simple code that would send an email with the same attachment and subject and recipient everytime I close down Outlook 2003. I did this once before on my old machine, and do not have the code any longer. Thanks! |
#3
|
|||
|
|||
![]()
Not sure what this means at all. I'm not talking about closing an explorer
window, and I am looking for the code to automate sending the email when OUTLOOK closes. In other words, a module within Outlook that will execute when outlook shuts down. Similar to a Auto_Close routine in Excel. "Michael Bauer [MVP - Outlook]" wrote: Please search for 'Explorer wrapper'. With that you're able to track when the last Explorer is going to close, that's the time for your e-mail. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Organize eMails: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Mon, 23 Jul 2007 13:56:01 -0700 schrieb Mike: I am looking for simple code that would send an email with the same attachment and subject and recipient everytime I close down Outlook 2003. I did this once before on my old machine, and do not have the code any longer. Thanks! |
#4
|
|||
|
|||
![]()
By the time you get any event such as Outlook.Quit or even the earlier
Explorer.Close on the last open Explorer, which is what Michael was talking about, it's too late to use Outlook to send an email. You'd have to directly address an SMTP server to send an email or something like that. It'd be way to late to get Outlook to do it. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Mike" wrote in message ... Not sure what this means at all. I'm not talking about closing an explorer window, and I am looking for the code to automate sending the email when OUTLOOK closes. In other words, a module within Outlook that will execute when outlook shuts down. Similar to a Auto_Close routine in Excel. "Michael Bauer [MVP - Outlook]" wrote: Please search for 'Explorer wrapper'. With that you're able to track when the last Explorer is going to close, that's the time for your e-mail. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Organize eMails: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Mon, 23 Jul 2007 13:56:01 -0700 schrieb Mike: I am looking for simple code that would send an email with the same attachment and subject and recipient everytime I close down Outlook 2003. I did this once before on my old machine, and do not have the code any longer. Thanks! |
#5
|
|||
|
|||
![]()
This has been done before though. I had it working. The new code I have this
time around is this: Private Sub Application_Quit() Dim oApp As Outlook.Application Dim oMail As Outlook.MailItem Set oApp = CreateObject("Outlook.Application") Set oMail = oApp.CreateItem(olMailItem) Set myAttachments = oMail.Attachments myAttachments.Add "H:\Personal\To Do.doc", olByValue, 1, "Fichier" oMail.To = " oMail.Subject = "To Do List " & Format(Date, "DDD mm/dd/yy") oMail.Send ' oApp.Quit Set oApp = Nothing End Sub The commented out oApp.Quit so that It would send the mail, but now it just stays in my outbox until the next time I open Outlook. "Ken Slovak - [MVP - Outlook]" wrote: By the time you get any event such as Outlook.Quit or even the earlier Explorer.Close on the last open Explorer, which is what Michael was talking about, it's too late to use Outlook to send an email. You'd have to directly address an SMTP server to send an email or something like that. It'd be way to late to get Outlook to do it. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Mike" wrote in message ... Not sure what this means at all. I'm not talking about closing an explorer window, and I am looking for the code to automate sending the email when OUTLOOK closes. In other words, a module within Outlook that will execute when outlook shuts down. Similar to a Auto_Close routine in Excel. "Michael Bauer [MVP - Outlook]" wrote: Please search for 'Explorer wrapper'. With that you're able to track when the last Explorer is going to close, that's the time for your e-mail. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Organize eMails: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Mon, 23 Jul 2007 13:56:01 -0700 schrieb Mike: I am looking for simple code that would send an email with the same attachment and subject and recipient everytime I close down Outlook 2003. I did this once before on my old machine, and do not have the code any longer. Thanks! |
#6
|
|||
|
|||
![]()
Actually, this CAN be done. I just added a msgbox at the end so that it would
give Outlook a second to get the message out of the outbox. I used a msgbox that would only display for 2 seconds then close. CreateObject("WScript.Shell").Popup "To-Do List Sent", 2, "Done!" "Mike" wrote: This has been done before though. I had it working. The new code I have this time around is this: Private Sub Application_Quit() Dim oApp As Outlook.Application Dim oMail As Outlook.MailItem Set oApp = CreateObject("Outlook.Application") Set oMail = oApp.CreateItem(olMailItem) Set myAttachments = oMail.Attachments myAttachments.Add "H:\Personal\To Do.doc", olByValue, 1, "Fichier" oMail.To = " oMail.Subject = "To Do List " & Format(Date, "DDD mm/dd/yy") oMail.Send ' oApp.Quit Set oApp = Nothing End Sub The commented out oApp.Quit so that It would send the mail, but now it just stays in my outbox until the next time I open Outlook. "Ken Slovak - [MVP - Outlook]" wrote: By the time you get any event such as Outlook.Quit or even the earlier Explorer.Close on the last open Explorer, which is what Michael was talking about, it's too late to use Outlook to send an email. You'd have to directly address an SMTP server to send an email or something like that. It'd be way to late to get Outlook to do it. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Mike" wrote in message ... Not sure what this means at all. I'm not talking about closing an explorer window, and I am looking for the code to automate sending the email when OUTLOOK closes. In other words, a module within Outlook that will execute when outlook shuts down. Similar to a Auto_Close routine in Excel. "Michael Bauer [MVP - Outlook]" wrote: Please search for 'Explorer wrapper'. With that you're able to track when the last Explorer is going to close, that's the time for your e-mail. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Organize eMails: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Mon, 23 Jul 2007 13:56:01 -0700 schrieb Mike: I am looking for simple code that would send an email with the same attachment and subject and recipient everytime I close down Outlook 2003. I did this once before on my old machine, and do not have the code any longer. Thanks! |
#7
|
|||
|
|||
![]()
If it works for you great. I wouldn't instantiate an Outlook session inside
the Quit event myself. But that's up to you. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Mike" wrote in message ... Actually, this CAN be done. I just added a msgbox at the end so that it would give Outlook a second to get the message out of the outbox. I used a msgbox that would only display for 2 seconds then close. CreateObject("WScript.Shell").Popup "To-Do List Sent", 2, "Done!" |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Forward email closes Word? | Penny Miller | Outlook - General Queries | 0 | September 5th 06 07:42 PM |
outlook process never closes??? | luis | Outlook - General Queries | 4 | April 22nd 06 03:47 PM |
Email editor closes when forwarding Excel-embedded email | Outlook - General Queries | 0 | March 18th 06 03:01 PM | |
Email editor closes when forwarding Excel-embedded email | Outlook - Installation | 0 | March 18th 06 03:01 PM | |
Outlook closes do to errors every time I send an E-Mail. | don | Outlook - Installation | 0 | March 4th 06 06:39 PM |