If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Explorer' Close event not fired
Hi All,
I have Outtlook Addin (C# 2.0, VSTO 2005, Outlook 2003), i subscribed to close event: explorerEvents.Close += new Outlook.ExplorerEvents_10_CloseEventHandler(OnExpl orerClose); but i never get there, why??? Only if i open another explorer (right click on folder-- Open in new folder), and close it , then i get the close event fired, but when i have only one explorer (main explorer) it's seem to be never fired. P.S. I also susbscribe to FolderSwitch and SelectionChange explorer events , they works fine. Any suggestions?? |
Ads |
#2
|
|||
|
|||
Explorer' Close event not fired
It sounds like you're not subscribing to the correct Explorer's events and
that you're not using a wrapper collection for open Explorers. If you were you wouldn't get Close on the first Explorer after opening a second Explorer. Are you getting ActiveExplorer and subscribing to that in the Startup event handler in your VSTO addin? FWIW I do get all Explorer events including on the first Explorer and separate events in my Explorer wrappers for each Explorer event I subscribe to including Close(). -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "j" wrote in message oups.com... Hi All, I have Outtlook Addin (C# 2.0, VSTO 2005, Outlook 2003), i subscribed to close event: explorerEvents.Close += new Outlook.ExplorerEvents_10_CloseEventHandler(OnExpl orerClose); but i never get there, why??? Only if i open another explorer (right click on folder-- Open in new folder), and close it , then i get the close event fired, but when i have only one explorer (main explorer) it's seem to be never fired. P.S. I also susbscribe to FolderSwitch and SelectionChange explorer events , they works fine. Any suggestions?? |
#3
|
|||
|
|||
Explorer' Close event not fired
Thanks,
It sounds like you're not subscribing to the correct Explorer's events and but also i subscribed to FolderSwitch, and SelectionChange events, and they fires well. that you're not using a wrapper collection for open Explorers. If you were you wouldn't get Close on the first Explorer after opening a second Explorer. Sorry probably i didn't explain right my problem, but if open another explorer (NewWindow) on this just opened explorer on closing it teh Close event will fire. On main explorer (explorer that i get when Outlook is starts) i never get close event. Are you getting ActiveExplorer and subscribing to that in the Startup event handler in your VSTO addin? Yes that exactly what i'm doing. Any other suggestions??, Things that i should check?? Thanks in Advance. |
#4
|
|||
|
|||
Explorer' Close event not fired
Not offhand. Post the parts of the code you're using to set up your Explorer
events handlers. Maybe we'll see something. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "j" wrote in message oups.com... Thanks, It sounds like you're not subscribing to the correct Explorer's events and but also i subscribed to FolderSwitch, and SelectionChange events, and they fires well. that you're not using a wrapper collection for open Explorers. If you were you wouldn't get Close on the first Explorer after opening a second Explorer. Sorry probably i didn't explain right my problem, but if open another explorer (NewWindow) on this just opened explorer on closing it teh Close event will fire. On main explorer (explorer that i get when Outlook is starts) i never get close event. Are you getting ActiveExplorer and subscribing to that in the Startup event handler in your VSTO addin? Yes that exactly what i'm doing. Any other suggestions??, Things that i should check?? Thanks in Advance. |
#5
|
|||
|
|||
Explorer' Close event not fired
Thanks, outlookExplorer is hold reference to Explorer Outlook.ExplorerEvents_10_Event explorerEvents = (Outlook.ExplorerEvents_10_Event)outlookExplorer ; explorerEvents.Close += new Outlook.ExplorerEvents_10_CloseEventHandler(OnExpl orerClose); explorerEvents.FolderSwitch += new Outlook.ExplorerEvents_10_FolderSwitchEventHandler (explorerEvents_FolderSwitch); explorerEvents.SelectionChange += new Outlook.ExplorerEvents_10_SelectionChangeEventHand ler(explorerEvents_SelectionChange); thats All, tnx |
#6
|
|||
|
|||
Explorer' Close event not fired
And this is called in your Startup() event handler? And outlookExplorer is
declared at class level and not in the procedure? What you show looks OK to me. I usually test for something like this: if(Outlook.ActiveExplorer() != null) { outlookExplorer = Outlook.ActiveExplorer(); // then I add the Explorer events } -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "j" wrote in message oups.com... Thanks, outlookExplorer is hold reference to Explorer Outlook.ExplorerEvents_10_Event explorerEvents = (Outlook.ExplorerEvents_10_Event)outlookExplorer ; explorerEvents.Close += new Outlook.ExplorerEvents_10_CloseEventHandler(OnExpl orerClose); explorerEvents.FolderSwitch += new Outlook.ExplorerEvents_10_FolderSwitchEventHandler (explorerEvents_FolderSwitch); explorerEvents.SelectionChange += new Outlook.ExplorerEvents_10_SelectionChangeEventHand ler(explorerEvents_SelectionChange); thats All, tnx |
#7
|
|||
|
|||
Explorer' Close event not fired
Thanks, And this is called in your Startup() event handler? Yes this is exactly what i'm doing, and outlookExplorer is declared at class level. Another suggestions??? Thanks in Advance. |
#8
|
|||
|
|||
Explorer' Close event not fired
The only other things I can think of is for you to show more of your code,
the complete Startup() event handler where you are instantiating your Explorer event handler and the event handler itself. Maybe that will show something, or to go to look at the Explorer handler sample in C# at http://www.outlookcode.com/codedetail.aspx?id=789 and see how that compares to your code. The code I use is similar to Helmut's code in his Explorer wrapper example referenced above. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "j" wrote in message oups.com... Thanks, And this is called in your Startup() event handler? Yes this is exactly what i'm doing, and outlookExplorer is declared at class level. Another suggestions??? Thanks in Advance. |
#9
|
|||
|
|||
Explorer' Close event not fired
Thanks,
I created new Addin that have nothing besides subscribing to BeforeFolderSwitch and Explorer close events: public partial class ThisApplication { Outlook.ExplorerClass expl; private void ThisApplication_Startup(object sender, System.EventArgs e) { expl = this.ActiveExplorer() as Outlook.ExplorerClass; expl.ExplorerEvents_10_Event_Close += new Microsoft.Office.Interop.Outlook.ExplorerEvents_10 _CloseEventHandler(expl_ExplorerEvents_10_Event_Cl ose); exp.ExplorerEvents_Event_BeforeFolderSwitch += new Microsoft.Office.Interop.Outlook.ExplorerEvents_Be foreFolderSwitchEventHandler(exp_ExplorerEvents_Ev ent_BeforeFolderSwitch); } void exp_ExplorerEvents_Event_BeforeFolderSwitch(object NewFolder, ref bool Cancel) { MessageBox.Show("Expl before folderSwitch event"); } void expl_ExplorerEvents_10_Event_Close() { MessageBox.Show("Explorer Close!"); } private void ThisApplication_Shutdown(object sender, System.EventArgs e) { MessageBox.Show("Application_Shutdown"); } All events fired but close NOT. Technologies i'm using: .Net 2.0, Outlook 2003, VSTO 2005 Any suggestion??? Thanks in advance. |
#10
|
|||
|
|||
Explorer' Close event not fired
It looks like that's going to be normal for VSTO. I do get Explorer_Close
events even on that first Explorer, but I'm using an Explorer wrapper collection and the close event is firing in the close handler of my wrappers. A close in the ThisApplication class is not firing under those conditions. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "j" wrote in message oups.com... Thanks, I created new Addin that have nothing besides subscribing to BeforeFolderSwitch and Explorer close events: public partial class ThisApplication { Outlook.ExplorerClass expl; private void ThisApplication_Startup(object sender, System.EventArgs e) { expl = this.ActiveExplorer() as Outlook.ExplorerClass; expl.ExplorerEvents_10_Event_Close += new Microsoft.Office.Interop.Outlook.ExplorerEvents_10 _CloseEventHandler(expl_ExplorerEvents_10_Event_Cl ose); exp.ExplorerEvents_Event_BeforeFolderSwitch += new Microsoft.Office.Interop.Outlook.ExplorerEvents_Be foreFolderSwitchEventHandler(exp_ExplorerEvents_Ev ent_BeforeFolderSwitch); } void exp_ExplorerEvents_Event_BeforeFolderSwitch(object NewFolder, ref bool Cancel) { MessageBox.Show("Expl before folderSwitch event"); } void expl_ExplorerEvents_10_Event_Close() { MessageBox.Show("Explorer Close!"); } private void ThisApplication_Shutdown(object sender, System.EventArgs e) { MessageBox.Show("Application_Shutdown"); } All events fired but close NOT. Technologies i'm using: .Net 2.0, Outlook 2003, VSTO 2005 Any suggestion??? Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Inspector Close Event is fired when spell checking is canceled. | Arcady | Outlook and VBA | 6 | December 28th 06 02:38 PM |
Explorer onOpen event | BartH_NL | Outlook and VBA | 4 | November 21st 06 08:50 AM |
What event gets fired when i show/hide my outlook toolbar | Gautam | Outlook and VBA | 1 | July 12th 06 02:21 PM |
Trigger event on explorer right click (unselected item)? | james | Add-ins for Outlook | 5 | February 22nd 06 09:12 PM |
Help! Inspector.Close is fired before Inspector.Activate handler finishes | Sergey Anchipolevsky | Add-ins for Outlook | 8 | February 9th 06 09:51 AM |