Any way to prevent new message from being sent

B

Ben Kalegin

Hello All,

Does anybody know any (cdo/mapi/redemption) way to block the new message
being sent?
I am required following scenario:

1. User clicks New Mail
2. Com Addin creates custom controls
3. Clicks, typpings, selection and other business specific
4. User press "Send Mail". This event is handled, multiple emails are
created using redemption for access to original mail fields.
Then the original email should be discarded. If I set Cancel = True in
either MailItem.OnSend or App.OnItemSend, all my manual emails are discarded
too.
If I set Cancel = False, then original email goes to outbox and delivered.
I have try to intercept email in Folder(Outbox).Items.OnAdd using Move or
Delete, but this cause internal outlook exception.

Any Ideas?

P.S. Solution must be compatible with Outlook 2K & Ootlook2K2, IMO mode
 
D

Dmitry Streblechenko

When you process Application.ItemSend event, are you sure you only set
Cancel = true for the original e-mail, and not for the other e-mails?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top