locked
keep email not send in send/receive event RRS feed

  • Question

  • hi

    in my program when email in outbox and users click send/receive, i want the program to check the email for some condition, if one of them doesn't match, this email won't be sent and will keep in outbox, but the others will send.

    i use Microsoft.Office.Interop.Outlook.SyncObjectEvents_SyncStartEventHandler to catch the send/receive event

    is it possible to do like this?

    thank you

    Monday, March 7, 2011 3:59 PM

Answers

  • No, that event will not trap any automatic or manually generated send/receives. It will only trap send/receives that you initiate in your code. There really is no event that can be handled to know when an Outlook send/receive is started or in progress or is finished unfortunately, unless that operation was started by your own code.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "John83 Zheng" <=?utf-8?B?Sm9objgzIFpoZW5n?=> wrote in message news:06284f34-d5d1-417a-acf0-b31e5ae3f0f0...

    hi

    in my program when email in outbox and users click send/receive, i want the program to check the email for some condition, if one of them doesn't match, this email won't be sent and will keep in outbox, but the others will send.

    i use Microsoft.Office.Interop.Outlook.SyncObjectEvents_SyncStartEventHandler to catch the send/receive event

    is it possible to do like this?

    thank you


    Ken Slovak MVP - Outlook
    • Marked as answer by 许阳(无锡) Wednesday, March 23, 2011 9:47 AM
    Monday, March 7, 2011 7:32 PM
  • Why not use Application.ItemSend event and cancel the submission there?
    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    • Marked as answer by 许阳(无锡) Wednesday, March 23, 2011 9:47 AM
    Tuesday, March 8, 2011 6:23 AM

All replies

  • No, that event will not trap any automatic or manually generated send/receives. It will only trap send/receives that you initiate in your code. There really is no event that can be handled to know when an Outlook send/receive is started or in progress or is finished unfortunately, unless that operation was started by your own code.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "John83 Zheng" <=?utf-8?B?Sm9objgzIFpoZW5n?=> wrote in message news:06284f34-d5d1-417a-acf0-b31e5ae3f0f0...

    hi

    in my program when email in outbox and users click send/receive, i want the program to check the email for some condition, if one of them doesn't match, this email won't be sent and will keep in outbox, but the others will send.

    i use Microsoft.Office.Interop.Outlook.SyncObjectEvents_SyncStartEventHandler to catch the send/receive event

    is it possible to do like this?

    thank you


    Ken Slovak MVP - Outlook
    • Marked as answer by 许阳(无锡) Wednesday, March 23, 2011 9:47 AM
    Monday, March 7, 2011 7:32 PM
  • Why not use Application.ItemSend event and cancel the submission there?
    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    • Marked as answer by 许阳(无锡) Wednesday, March 23, 2011 9:47 AM
    Tuesday, March 8, 2011 6:23 AM