none
ItemEvents_SendEventHandler not send every time RRS feed

  • Question

  • Using Win7 64bit, vs studio 2010, outlook 2007

    Trying to register a send event for an appointment item.

    Registering in FormRegionShowing:

    AppointmentItem item = this.OutlookItem as AppointmentItem;
    ItemEvents_Event itemEvents = (ItemEvents_Event)item;
    itemEvents.Send += new ItemEvents_SendEventHandler(ItemSendEventHandler);

    This works most the time i press the send Button for an Appointment (including room reservation and several recipients).

    In my form region i have several controls which i read out and create a body text befor sending the item.

    When i wait about 3 seconds after filling out my form befor pressing the send button, no event is fired.

    Is this a Timing Issue? What are i am doing wrong?

    Working several days on this problem. My Boss is waiting for results...

    Wednesday, February 15, 2012 9:47 AM

Answers

  • Declare the item and itemEvents at class level so they don't get garbage collected. That will keep them alive and keep the events firing.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "uid developer" <=?utf-8?B?dWlkIGRldmVsb3Blcg==?=> wrote in message news:191409ae-ac91-4386-8f4d-e427f944bcbf...

    Using Win7 64bit, vs studio 2010, outlook 2007

    Trying to register a send event for an appointment item.

    Registering in FormRegionShowing:

    AppointmentItem item = this.OutlookItem as AppointmentItem;
    ItemEvents_Event itemEvents = (ItemEvents_Event)item;
    itemEvents.Send += new ItemEvents_SendEventHandler(ItemSendEventHandler);

    This works most the time i press the send Button for an Appointment (including room reservation and several recipients).

    In my form region i have several controls which i read out and create a body text befor sending the item.

    When i wait about 3 seconds after filling out my form befor pressing the send button, no event is fired.

    Is this a Timing Issue? What are i am doing wrong?

    Working several days on this problem. My Boss is waiting for results...


    Ken Slovak MVP - Outlook
    Wednesday, February 15, 2012 3:41 PM
    Moderator

All replies

  • You do not need to case to events interface to get Send event, but if you do, remember that you need to keep reference to that object alive (for example storing it somewhere, just like this.OutlookItem) otherwise it will get garbage collected and event will stop firing.
    Wednesday, February 15, 2012 10:28 AM
  • Intellisense does not offer me a send event for AppointmentItem. But Before..., Attachement..., Write, Read.

    Only casting to ItemEvents_Event offers me a send event.

    I think send event is the correct event listening to...

    Wednesday, February 15, 2012 10:58 AM
  • what about second part? Keep your itemEvents in some class field, like OutlookItem, so it will not get garbage collected - does this make your error go away?

    Wednesday, February 15, 2012 11:23 AM
  • Declare the item and itemEvents at class level so they don't get garbage collected. That will keep them alive and keep the events firing.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "uid developer" <=?utf-8?B?dWlkIGRldmVsb3Blcg==?=> wrote in message news:191409ae-ac91-4386-8f4d-e427f944bcbf...

    Using Win7 64bit, vs studio 2010, outlook 2007

    Trying to register a send event for an appointment item.

    Registering in FormRegionShowing:

    AppointmentItem item = this.OutlookItem as AppointmentItem;
    ItemEvents_Event itemEvents = (ItemEvents_Event)item;
    itemEvents.Send += new ItemEvents_SendEventHandler(ItemSendEventHandler);

    This works most the time i press the send Button for an Appointment (including room reservation and several recipients).

    In my form region i have several controls which i read out and create a body text befor sending the item.

    When i wait about 3 seconds after filling out my form befor pressing the send button, no event is fired.

    Is this a Timing Issue? What are i am doing wrong?

    Working several days on this problem. My Boss is waiting for results...


    Ken Slovak MVP - Outlook
    Wednesday, February 15, 2012 3:41 PM
    Moderator