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