Thread: Before Send
View Single Post
  #10  
Old October 17th 08, 05:53 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Before Send

What you're missing is what you're going to run into with methods/events
that overload the same keyword in all managed code. In this case
AppointmentItem doesn't directly expose the Send event since it uses the
same keyword as the Send method.

There are a couple of ways to do what you need to do:

1. Declare at class level an ItemEvents_Event object, say _apptEvents:
private Outlook.ItemEvents_Event _apptEvents;

Then instantiate the event handler so:
_apptEvents = (Outlook.ItemEvents_Event)_appt;
_apptEvents.Send += new Outlook.ItemEvents_SendEventHandler(myHandler);

2. An alternative is to use AppointmentItemClass:
private Outlook.AppointmentItemClass _itemClass; // class level

Then instantiate as follows:
_itemClass = (Outlook.AppointmentItemClass) _appt;
_itemClass.ItemEvents_10_Event_Send += etc.

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


"BigDubb" wrote in message
...
I am not seeing an Appointment.Send Event, rather an Send Method.

When trying to make the event handler for the send method I get the
following error
"Cannot assign to 'Send' because it is a 'method group' "

Here is the syntax
AppointmentItem _appt = this.OutlookItem as Outlook.AppointmentItem;
if(_appt == null)
return;

_appt.Send += new
Outlook.ApplicationEvents_11_ItemSendEventHandler( Application_ItemSend);


What am I missing?


Ads