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

how to stop emails from being sent in outlook via code



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 21st 08, 07:48 PM posted to microsoft.public.outlook.program_vba
Greg J
external usenet poster
 
Posts: 8
Default how to stop emails from being sent in outlook via code

Hi,

I would like to control when emails get sent from Outlook. For
instance, when a user clicks send, some code needs to run. If the
result of the code that runs is acceptable, the email gets sent,
otherwise the message remains in the outbox. So I guess the event I
need to tap into is the one that checks the outbox for messages to be
sent and not the event that adds the item to the outbox items as items
will need to remain in the outbox until the result of the code that
runs is satisfactory.

I am using redemption in my code so would prefer to use that if at all
possible.

Thanks in advance.


Regards


Greg J
  #2  
Old September 22nd 08, 02:11 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default how to stop emails from being sent in outlook via code

Once a message is submitted to the transport if you mess with it in code it
either will abort the process or you'll get an error that the item has been
moved and is unavailable. You really should cancel the send in the Send()
event and move it to a holding folder. Then after processing it you can send
it again, or you can do your processing in the Send event and cancel that if
needed.

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


"Greg J" wrote in message
...
Hi,

I would like to control when emails get sent from Outlook. For
instance, when a user clicks send, some code needs to run. If the
result of the code that runs is acceptable, the email gets sent,
otherwise the message remains in the outbox. So I guess the event I
need to tap into is the one that checks the outbox for messages to be
sent and not the event that adds the item to the outbox items as items
will need to remain in the outbox until the result of the code that
runs is satisfactory.

I am using redemption in my code so would prefer to use that if at all
possible.

Thanks in advance.


Regards


Greg J


  #3  
Old September 29th 08, 09:48 PM posted to microsoft.public.outlook.program_vba
Greg J
external usenet poster
 
Posts: 8
Default how to stop emails from being sent in outlook via code

On Sep 22, 11:11*pm, "Ken Slovak - [MVP - Outlook]"
wrote:
Once a message is submitted to the transport if you mess with it in code it
either will abort the process or you'll get an error that the item has been
moved and is unavailable. You really should cancel the send in the Send()
event and move it to a holding folder. Then after processing it you can send
it again, or you can do your processing in the Send event and cancel that if
needed.

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

"Greg J" wrote in message

...



Hi,


I would like to control when emails get sent from Outlook. *For
instance, when a user clicks send, some code needs to run. *If the
result of the code that runs is acceptable, the email gets sent,
otherwise the message remains in the outbox. *So I guess the event I
need to tap into is the one that checks the outbox for messages to be
sent and not the event that adds the item to the outbox items as items
will need to remain in the outbox until the result of the code that
runs is satisfactory.


I am using redemption in my code so would prefer to use that if at all
possible.


Thanks in advance.


Regards


Greg J- Hide quoted text -


- Show quoted text -


Hi Ken,

thanks for this, good advice
 




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
Stop bracketting false area code when displaying phone no MonocleMike Outlook - Using Contacts 8 October 19th 08 04:34 AM
Can I stop Outlook from deleting emails from server Gordon D Outlook - General Queries 1 April 4th 08 10:29 AM
Stop Outlook forcing area code on mobile numbers Jisher Outlook - Using Contacts 1 August 22nd 07 02:26 PM
How do i stop Strikethrough on deleted emails in Outlook John Outlook - General Queries 2 June 24th 06 08:48 PM
how to stop duplicate emails in outlook 2003? underbob Outlook - Installation 1 June 1st 06 12:14 PM


All times are GMT +1. The time now is 10:40 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.