How to stop email in the outbox

G

GA Kvarud

I have an add-in for Outlook, that is supposed to check emails before they
are sent, in order to check if certain conditions are fulfilled. It works by
catching the inspectors_NewInspector-event, and grabbing the item. If the
conditions are not filled, the Cancel option of the item_send event is used.

If anyone uses the File, Send-command in Office, there is a problem, as with
some of the options, no Inspector is created. I therefore cannot get to the
item.

I am able to catch it as it enters the outbox (items_ItemAdd), and can check
it. But is there any way to stop an item from being sent, when it has
arrived in the outbox? I have not found any neither in Outlook or with the
help of Redemption.dll.

Or are there any other way of achieving the same?

Thank you for your answers.

Sincerely
Geir-André Kvarud
 
P

Pablo Yabo

I think that you should try the Exchange events.
If you return S_OK in the OnSubmit event the message is not sent.
I did it using C++, I don't know if this can be done using VB.

Regards,
Pablo Yabo.
http://www.nektra.com
 
J

Jonatan

Can you not move the item to the Deleted Items folder??

That should stop the sending!!
 
G

Guest

May be you can try to use
Exchange Client Extension and implement IExchExtMessageEvents.

--
WBR
Henry


"GA Kvarud" пишет:
 
G

GA Kvarud

Thank you for your answer.

One of these days I will have to learn C++. Seems like everything I want to
do, require some interface Visual Basic cannot handle...

If you know of a way to use this from VB, I would be happy for a pointer.

Thank you!

Geir-André
 
G

GA Kvarud

I have tried that without any luck. Tried it again now, and it seems that if
it is moved immediately (on the very first line of code in the event
handler), it might work. If I check first, then it is sent before my tests
are finished. Will have to test more to see if the immediate move will
allways work.

Thank you for your answer!

Geir-André
 
G

GA Kvarud

I am not sure what you refer to as "Exchange events". Would that be on the
server? I will need to do this on the client, as part of the test that is to
be performed is to be interactive.

If this is indeed a client-approach, I would be thankful for some more
information (a link or something)
 

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