A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Strange Behaviour of Explorer Object.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 6th 09, 03:15 PM posted to microsoft.public.outlook.program_addins
JIGNESH
external usenet poster
 
Posts: 5
Default Strange Behaviour of Explorer Object.

Since I can;t Post images here. Please refer to following url for Image.
http://accenture.dotnetjini.com/OutLookAddInError.jpg

In Explorer DeActivate Event i am calling This.Application.ActiveExplorer().
It does not return null, but if i query its Selection Property it throws an
exception.

I am surprize to see that for other properties there is no exception
generated. (as seen in image)

Why is this behaviour, I don;t understand. is it because of poor outlook API?

The Details of error is.
System.Runtime.InteropServices.COMException occurred
Message="The Explorer has been closed and cannot be used for further
operations. Review your code and restart Outlook."
Source="Microsoft Office Outlook"
ErrorCode=-624820215
StackTrace:
at Microsoft.Office.Interop.Outlook.ExplorerClass.get _Selection()
at
OutlookAddIn3.ThisAddIn.wrappedExplorer_ExplorerDe Activate(MailItem
p_currentMailItem) in D:\2009Trainings\outlookTest\ThisAddIn.cs:line 242
InnerException:


Please advice.

Regards




Ads
  #2  
Old May 7th 09, 02:41 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Strange Behaviour of Explorer Object.

The state of ActiveExplorer() during Deactivate() is going to be
indeterminate. Why do you need the Selection collection then?

Why not on Activate() and then handling selection changes in the
SelectionChange() event?

Or you can get a handle to that specific Explorer on Activate() and use that
instead of ActiveExplorer().

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


"JIGNESH" wrote in message
...
Since I can;t Post images here. Please refer to following url for Image.
http://accenture.dotnetjini.com/OutLookAddInError.jpg

In Explorer DeActivate Event i am calling
This.Application.ActiveExplorer().
It does not return null, but if i query its Selection Property it throws
an
exception.

I am surprize to see that for other properties there is no exception
generated. (as seen in image)

Why is this behaviour, I don;t understand. is it because of poor outlook
API?

The Details of error is.
System.Runtime.InteropServices.COMException occurred
Message="The Explorer has been closed and cannot be used for further
operations. Review your code and restart Outlook."
Source="Microsoft Office Outlook"
ErrorCode=-624820215
StackTrace:
at Microsoft.Office.Interop.Outlook.ExplorerClass.get _Selection()
at
OutlookAddIn3.ThisAddIn.wrappedExplorer_ExplorerDe Activate(MailItem
p_currentMailItem) in D:\2009Trainings\outlookTest\ThisAddIn.cs:line 242
InnerException:


Please advice.

Regards





 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange email behaviour when I send Pete Zahut Outlook Express 10 April 16th 09 06:09 PM
Strange behaviour in cached mode John C Outlook - General Queries 0 August 3rd 08 05:58 PM
Strange behaviour with Type Error Tobias Schröer Outlook and VBA 0 January 31st 07 09:48 AM
strange behaviour after IE7 upgrade Tony Linguini Outlook - General Queries 0 October 21st 06 03:17 AM
Strange OE6 behaviour Patrick E. King Outlook Express 2 April 26th 06 06:59 AM


All times are GMT +1. The time now is 05:55 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.