![]() |
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
|
|||
|
|||
![]()
Hi. I would like to create a custom action that pops up a message box on
sending an email. This will ask me whether I would like this saved to my sent items folder or not. This will make organising my sent items much easier later on. Any ideas...? |
#2
|
|||
|
|||
![]()
A better solution would be to use an Application_ItemSend event handler that
will fire every time an item is sent and show a message box asking whether to save to Sent Items and if the answer is no to set the DeleteAfterSubmit Boolean property to True. If macros are enabled and this code is in ThisOutlookSession you will have what you want, but I'd think it would get annoying after a while to be prompted after sending every email. Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim answer As Long If Item.Class = olMail Then answer = MsgBox("Do you want to save this email: " & _ Item.Subject & " to Sent Items?", vbYesNo) If answer = vbNo Then Item.DeleteAfterSubmit = True End If End If End Sub -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Robin" wrote in message ... Hi. I would like to create a custom action that pops up a message box on sending an email. This will ask me whether I would like this saved to my sent items folder or not. This will make organising my sent items much easier later on. Any ideas...? |
#3
|
|||
|
|||
![]()
That's perfect thanks. I know this might result in a small amount of pain,
but I am sure it will be worth it when it comes to organising my sent emails. A bells and whistles version of this would be a form which pops up after sending an email which shows my outlook folders and asks me to which folder I want file the sent email with a "DELETE EMAIL" as the top option. Painful I know but I will have to do this some time anyway... Cheers. "Ken Slovak - [MVP - Outlook]" wrote: A better solution would be to use an Application_ItemSend event handler that will fire every time an item is sent and show a message box asking whether to save to Sent Items and if the answer is no to set the DeleteAfterSubmit Boolean property to True. If macros are enabled and this code is in ThisOutlookSession you will have what you want, but I'd think it would get annoying after a while to be prompted after sending every email. Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim answer As Long If Item.Class = olMail Then answer = MsgBox("Do you want to save this email: " & _ Item.Subject & " to Sent Items?", vbYesNo) If answer = vbNo Then Item.DeleteAfterSubmit = True End If End If End Sub -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Robin" wrote in message ... Hi. I would like to create a custom action that pops up a message box on sending an email. This will ask me whether I would like this saved to my sent items folder or not. This will make organising my sent items much easier later on. Any ideas...? |
#4
|
|||
|
|||
![]()
Sorry, one little snag. When I click on send, the PC freezes. I have to click
on the Microsoft Outlook tab on the taskbar which brings the message box to the front and then select YES/NO. Any ideas on how to solve this (minimise current window?) Thanks again "Robin" wrote: That's perfect thanks. I know this might result in a small amount of pain, but I am sure it will be worth it when it comes to organising my sent emails. A bells and whistles version of this would be a form which pops up after sending an email which shows my outlook folders and asks me to which folder I want file the sent email with a "DELETE EMAIL" as the top option. Painful I know but I will have to do this some time anyway... Cheers. "Ken Slovak - [MVP - Outlook]" wrote: A better solution would be to use an Application_ItemSend event handler that will fire every time an item is sent and show a message box asking whether to save to Sent Items and if the answer is no to set the DeleteAfterSubmit Boolean property to True. If macros are enabled and this code is in ThisOutlookSession you will have what you want, but I'd think it would get annoying after a while to be prompted after sending every email. Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim answer As Long If Item.Class = olMail Then answer = MsgBox("Do you want to save this email: " & _ Item.Subject & " to Sent Items?", vbYesNo) If answer = vbNo Then Item.DeleteAfterSubmit = True End If End If End Sub -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Robin" wrote in message ... Hi. I would like to create a custom action that pops up a message box on sending an email. This will ask me whether I would like this saved to my sent items folder or not. This will make organising my sent items much easier later on. Any ideas...? |
#5
|
|||
|
|||
![]()
Using WordMail, correct? That's a problem. Word is being subclassed by
Outlook and WordMail items are a weird mix of in and out of process threads. The bottom line is that the parent window of the message box is most likely the Outlook Explorer window and not the WordMail window. The best way to fix that is to display a dialog box non-modally, get its hWnd and use that in a call to SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE). After that call to set your dialog on top of all other windows you can then make the dialog modal. An easier alternative that doesn't involve hacks with Win32 API calls would be to not use WordMail. If you decide to use the hack approach all those consts and the declaration for SetWindowPos are in the MSDN library. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Robin" wrote in message ... Sorry, one little snag. When I click on send, the PC freezes. I have to click on the Microsoft Outlook tab on the taskbar which brings the message box to the front and then select YES/NO. Any ideas on how to solve this (minimise current window?) Thanks again |
#6
|
|||
|
|||
![]()
Thanks Ken. It works fine wih the non-Wordmail option. Much appreciated.
"Ken Slovak - [MVP - Outlook]" wrote: Using WordMail, correct? That's a problem. Word is being subclassed by Outlook and WordMail items are a weird mix of in and out of process threads. The bottom line is that the parent window of the message box is most likely the Outlook Explorer window and not the WordMail window. The best way to fix that is to display a dialog box non-modally, get its hWnd and use that in a call to SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE). After that call to set your dialog on top of all other windows you can then make the dialog modal. An easier alternative that doesn't involve hacks with Win32 API calls would be to not use WordMail. If you decide to use the hack approach all those consts and the declaration for SetWindowPos are in the MSDN library. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Robin" wrote in message ... Sorry, one little snag. When I click on send, the PC freezes. I have to click on the Microsoft Outlook tab on the taskbar which brings the message box to the front and then select YES/NO. Any ideas on how to solve this (minimise current window?) Thanks again |
#7
|
|||
|
|||
![]()
Hi I'm trying to something similar only instead of saving the reply I would
like it to delete the original message from the inbox. Is this doable? "Robin" wrote: Hi. I would like to create a custom action that pops up a message box on sending an email. This will ask me whether I would like this saved to my sent items folder or not. This will make organising my sent items much easier later on. Any ideas...? |
#8
|
|||
|
|||
![]()
Yes, that is quite possible. You can trap the MailItem's Send event and
throw your dialog there. The ActiveExplorer.Selection object should contain a reference to the message that is being replied to, or one of the messages in the Application.Inspectors collection. In either situation, you can loop through the collection and compare the Subject property with the current reply message. -- Eric Legault [MVP - Outlook] MCDBA, MCTS (Messaging & Collaboration, SharePoint Infrastructure, MOSS 2007 & WSS 3.0 Application Development) Collaborative Innovations - Try Picture Attachments Wizard For Microsoft Outlook - Web: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault "M.D'Souza" wrote in message ... Hi I'm trying to something similar only instead of saving the reply I would like it to delete the original message from the inbox. Is this doable? "Robin" wrote: Hi. I would like to create a custom action that pops up a message box on sending an email. This will ask me whether I would like this saved to my sent items folder or not. This will make organising my sent items much easier later on. Any ideas...? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom action | Ian | Outlook - General Queries | 9 | April 23rd 07 09:05 PM |
Save while sending email in Outlook | Marc C | Outlook and VBA | 1 | December 19th 06 06:55 PM |
Custom Action DLL with VB? | Menachem Bazian | Outlook - General Queries | 4 | August 18th 06 01:58 AM |
Outlook 2003 Custom Action on Outgoing Email Rules | Pankaj | Outlook and VBA | 1 | June 25th 06 09:35 AM |
custom action | adubb | Outlook - Using Forms | 1 | March 30th 06 08:17 PM |