PC Review


Reply
 
 
BigDubb
Guest
Posts: n/a
 
      16th Oct 2008
How would one prevent sending of an appontment object if all of the required
fields haven't been completed? I cant seem to find a before send event to
trap on.

Thanks.
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      16th Oct 2008
That's because there isn't such an event. However, the item.Send() event
does have a Cancel argument. Set that to True and that will cancel the send.

--
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" <(E-Mail Removed)> wrote in message
news:18250A3C-ACDC-44A6-87CD-(E-Mail Removed)...
> How would one prevent sending of an appontment object if all of the
> required
> fields haven't been completed? I cant seem to find a before send event to
> trap on.
>
> Thanks.


 
Reply With Quote
 
BigDubb
Guest
Posts: n/a
 
      16th Oct 2008
Thanks.

Actually I was able to get the Application object from the AppointmentItem
and add a handler on the ItemSend event, which is exactly what I was looking
for.

One caveat with this though, it seems to reload the send event when a
messagebox is shown, to notify the user as to why the request can't be sent.



"Ken Slovak - [MVP - Outlook]" wrote:

> That's because there isn't such an event. However, the item.Send() event
> does have a Cancel argument. Set that to True and that will cancel the send.
>
> --
> 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" <(E-Mail Removed)> wrote in message
> news:18250A3C-ACDC-44A6-87CD-(E-Mail Removed)...
> > How would one prevent sending of an appontment object if all of the
> > required
> > fields haven't been completed? I cant seem to find a before send event to
> > trap on.
> >
> > Thanks.

>
>

 
Reply With Quote
 
BigDubb
Guest
Posts: n/a
 
      16th Oct 2008
Another issue with this event....

If a user is attempting to cancel the request and a required value is not
set, then the send event is never executed.



"BigDubb" wrote:

> Thanks.
>
> Actually I was able to get the Application object from the AppointmentItem
> and add a handler on the ItemSend event, which is exactly what I was looking
> for.
>
> One caveat with this though, it seems to reload the send event when a
> messagebox is shown, to notify the user as to why the request can't be sent.
>
>
>
> "Ken Slovak - [MVP - Outlook]" wrote:
>
> > That's because there isn't such an event. However, the item.Send() event
> > does have a Cancel argument. Set that to True and that will cancel the send.
> >
> > --
> > 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" <(E-Mail Removed)> wrote in message
> > news:18250A3C-ACDC-44A6-87CD-(E-Mail Removed)...
> > > How would one prevent sending of an appontment object if all of the
> > > required
> > > fields haven't been completed? I cant seem to find a before send event to
> > > trap on.
> > >
> > > Thanks.

> >
> >

 
Reply With Quote
 
BigDubb
Guest
Posts: n/a
 
      16th Oct 2008
Ok...

The more I dig into this the more odd things react.

It appears as if the Send button on a Meeting/Appointment request fires off
a Send Event for every recipient on the appointment.

which after thinking about it, makes sense. However, how do I get my
UserDefined variables passed into the new appointment object for each
recipient?

This is a .Net C# solution.

What I"m doing so far.

On the FormRegionShowing method I added hooked a method to the current
application object.

_appt.Application.ItemSend += new
Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend)

Then in the method the handler references I test on a local variable

if (!_Qualified)
e.Cancel;


where _Qualified is a boolean value, that is set based on other criteria on
the form.

This feels like the correct implementation, but isn't reacting the right way.



"BigDubb" wrote:

> Another issue with this event....
>
> If a user is attempting to cancel the request and a required value is not
> set, then the send event is never executed.
>
>
>
> "BigDubb" wrote:
>
> > Thanks.
> >
> > Actually I was able to get the Application object from the AppointmentItem
> > and add a handler on the ItemSend event, which is exactly what I was looking
> > for.
> >
> > One caveat with this though, it seems to reload the send event when a
> > messagebox is shown, to notify the user as to why the request can't be sent.
> >
> >
> >
> > "Ken Slovak - [MVP - Outlook]" wrote:
> >
> > > That's because there isn't such an event. However, the item.Send() event
> > > does have a Cancel argument. Set that to True and that will cancel the send.
> > >
> > > --
> > > 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" <(E-Mail Removed)> wrote in message
> > > news:18250A3C-ACDC-44A6-87CD-(E-Mail Removed)...
> > > > How would one prevent sending of an appontment object if all of the
> > > > required
> > > > fields haven't been completed? I cant seem to find a before send event to
> > > > trap on.
> > > >
> > > > Thanks.
> > >
> > >

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      17th Oct 2008
Why not try the item.Send event as I suggested originally?

--
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" <(E-Mail Removed)> wrote in message
news:E077E016-82A0-4DC7-A994-(E-Mail Removed)...
> Ok...
>
> The more I dig into this the more odd things react.
>
> It appears as if the Send button on a Meeting/Appointment request fires
> off
> a Send Event for every recipient on the appointment.
>
> which after thinking about it, makes sense. However, how do I get my
> UserDefined variables passed into the new appointment object for each
> recipient?
>
> This is a .Net C# solution.
>
> What I"m doing so far.
>
> On the FormRegionShowing method I added hooked a method to the current
> application object.
>
> _appt.Application.ItemSend += new
> Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend)
>
> Then in the method the handler references I test on a local variable
>
> if (!_Qualified)
> e.Cancel;
>
>
> where _Qualified is a boolean value, that is set based on other criteria
> on
> the form.
>
> This feels like the correct implementation, but isn't reacting the right
> way.
>
>
>
> "BigDubb" wrote:
>
>> Another issue with this event....
>>
>> If a user is attempting to cancel the request and a required value is not
>> set, then the send event is never executed.
>>
>>
>>
>> "BigDubb" wrote:
>>
>> > Thanks.
>> >
>> > Actually I was able to get the Application object from the
>> > AppointmentItem
>> > and add a handler on the ItemSend event, which is exactly what I was
>> > looking
>> > for.
>> >
>> > One caveat with this though, it seems to reload the send event when a
>> > messagebox is shown, to notify the user as to why the request can't be
>> > sent.


 
Reply With Quote
 
BigDubb
Guest
Posts: n/a
 
      17th Oct 2008
There is no Item object in the parameters, nor understood by the class
associated to the new region.

Can you clarify further?

Again, this is not a VBA project, it is a VS2008 C# project.

"Ken Slovak - [MVP - Outlook]" wrote:

> Why not try the item.Send event as I suggested originally?
>
> --
> 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" <(E-Mail Removed)> wrote in message
> news:E077E016-82A0-4DC7-A994-(E-Mail Removed)...
> > Ok...
> >
> > The more I dig into this the more odd things react.
> >
> > It appears as if the Send button on a Meeting/Appointment request fires
> > off
> > a Send Event for every recipient on the appointment.
> >
> > which after thinking about it, makes sense. However, how do I get my
> > UserDefined variables passed into the new appointment object for each
> > recipient?
> >
> > This is a .Net C# solution.
> >
> > What I"m doing so far.
> >
> > On the FormRegionShowing method I added hooked a method to the current
> > application object.
> >
> > _appt.Application.ItemSend += new
> > Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend)
> >
> > Then in the method the handler references I test on a local variable
> >
> > if (!_Qualified)
> > e.Cancel;
> >
> >
> > where _Qualified is a boolean value, that is set based on other criteria
> > on
> > the form.
> >
> > This feels like the correct implementation, but isn't reacting the right
> > way.
> >
> >
> >
> > "BigDubb" wrote:
> >
> >> Another issue with this event....
> >>
> >> If a user is attempting to cancel the request and a required value is not
> >> set, then the send event is never executed.
> >>
> >>
> >>
> >> "BigDubb" wrote:
> >>
> >> > Thanks.
> >> >
> >> > Actually I was able to get the Application object from the
> >> > AppointmentItem
> >> > and add a handler on the ItemSend event, which is exactly what I was
> >> > looking
> >> > for.
> >> >
> >> > One caveat with this though, it seems to reload the send event when a
> >> > messagebox is shown, to notify the user as to why the request can't be
> >> > sent.

>
>

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      17th Oct 2008
It doesn't matter what type of project it is, it's still using the Outlook
object model.

If you have an appointment item you have an item. AppointmentItem has a Send
event that you can handle. Look at the object browser.

--
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" <(E-Mail Removed)> wrote in message
news:CC5CB176-2F4B-4B97-9E10-(E-Mail Removed)...
> There is no Item object in the parameters, nor understood by the class
> associated to the new region.
>
> Can you clarify further?
>
> Again, this is not a VBA project, it is a VS2008 C# project.


 
Reply With Quote
 
BigDubb
Guest
Posts: n/a
 
      17th Oct 2008
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?


"Ken Slovak - [MVP - Outlook]" wrote:

> It doesn't matter what type of project it is, it's still using the Outlook
> object model.
>
> If you have an appointment item you have an item. AppointmentItem has a Send
> event that you can handle. Look at the object browser.
>
> --
> 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" <(E-Mail Removed)> wrote in message
> news:CC5CB176-2F4B-4B97-9E10-(E-Mail Removed)...
> > There is no Item object in the parameters, nor understood by the class
> > associated to the new region.
> >
> > Can you clarify further?
> >
> > Again, this is not a VBA project, it is a VS2008 C# project.

>
>

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      17th Oct 2008
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" <(E-Mail Removed)> wrote in message
news:370B1999-9996-4E1F-89F1-(E-Mail Removed)...
>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?


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When selecting "Send to Email Recipient from Shell Menu ... there is no send/receive Donna Smith Windows Vista Print / Fax / Scan 0 16th Jul 2007 11:41 PM
Automatically send e-mails / send mailwithout press outlook send b =?Utf-8?B?TWFyY28=?= Microsoft Access Forms 0 28th Mar 2007 01:17 AM
MAPI and (texteditorapp)/File/Send-> (err)Send Mail failed to send =?Utf-8?B?c25vd21vc3M=?= Windows XP Help 3 13th Oct 2004 12:47 AM
using Send.Send() or Send.SendWait() to cause audio mute to happen Andy Purcell Microsoft C# .NET 0 28th Jun 2004 09:02 PM
the send a picture wizard no longer opens whne i try to send pics to an email re rpmgsxr Windows XP Photos 1 26th Mar 2004 09:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:59 AM.