Now the problem of email won't go out also occurs on Outlook 2003. So it is
not 2007 specific.
After comment out the explorer.SelectionChange, emailing resumes normal.
explorer.SelectionChange +=
new
Outlook.ExplorerEvents_10_SelectionChangeEventHandle(ThisAddIn_SelectionChanged);
The reason of using explorer.SelectionChange is to catch EntryIDs of the
appointments to be deleted.
The Email problem has been fixed in Outlook 2007 by replacing
SelectionChange with BeforeItemMove event.
What is the feasible solution for 2003?
I'll start a new thread.
"Jason" <a@a.com> wrote in message
news:%23zkIOkttJHA.4592@TK2MSFTNGP06.phx.gbl...
> Yes you are right. The problem only occurs when user clicks the Outbox
> folder then create a new mail. No problem if user has not highlighted the
> Outbox.
> Once the mail is stalled, no matter how many times you click Send and
> Receive button, it will stay there forever, even after user move to other
> folder or restart Outlook. You have to delete it, and create an new mail.
> What can I do then? Tell user not to select Outbox, or unselect the Outbox
> programmatically if user does that?
> " - " <kenslovak@mvps.org> wrote in message
> news:%23f$JhjstJHA.4592@TK2MSFTNGP06.phx.gbl...
> > You don't need to do anything for passing the event back to Outlook, it's
> > Outlook that fires the event for you. It will also only fire the event on
> > an Explorer you have instantiated, so this event should not be firing in
> > Outbox unless you switch the Explorer to viewing the Outbox. You should
> > not be doing that if that's what you are doing. Leave things in Outbox
> > alone and don't mess with them after sending or the items will just
> > remain in Outbox and never get sent.
>
>> > >
> >
>
>
>
>
>
>
>> "Jason" <a@a.com> wrote in message
> > news:%23xwXrXstJHA.2776@TK2MSFTNGP03.phx.gbl...
> >> The problem of mail not going out only occurs on Outlook 2007, not 2003.
> >
>>> I believe it is caused by the interception of Explorer's SelectionChange
> >> event.
> >
>>> //class level variable to hold event handler
> >> private Outlook.Explorer explorer = null;
> >
>>> private void ThisAddIn_Startup(object sender, System.EventArgs e)
> >> {
> >> explorer = this.Application.ActiveExplorer();
> >> explorer.SelectionChange += new
> >> Outlook.ExplorerEvents_10_SelectionChangeEventHandler(ThisAddIn_SelectionChanged);
> >> }
> >
>>> private void ThisAddIn_SelectionChanged()
> >> {
> >> // only handle appointments, nothing else
> >> if (explorer.Selection.Count > 0 && explorer.Selection[1] is
> >> Outlook.AppointmentItem)
> >> {
> >> ...
> >> }
> >> }
> >
>>> Once a new mail is created, Outlook put it into Outbox folder and fires
> >> 3 SelectionChange events.
> >
>>> I know JavaScript DOM event bubble up and vaguely remember one article
> >> mentioned about passing Outlook event out of event handler. How do I
> >> pass the Explorer's SelectionChange event back to Outlook, so Outlook
> >> can handle it as usual?
> >
>