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

Check for empty Explorer.Selection causes error in Outlook Today



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 1st 06, 04:28 AM posted to microsoft.public.outlook.program_addins
Slava Barouline
external usenet poster
 
Posts: 15
Default Check for empty Explorer.Selection causes error in Outlook Today

Hi guys

I have an explorer toolbar in my Add-in and when user presses buttons on it,
Add-in does something to a selected mail item.

When I am in Outlook Today, it doesn't work - for unknown reason the check
Assigned(IExplorer.Selection) raises an exception.

IExplorer is not empty.

Why is it so?

Thanks
Slava


  #2  
Old December 1st 06, 06:18 AM posted to microsoft.public.outlook.program_addins
Slava Barouline
external usenet poster
 
Posts: 15
Default Check for empty Explorer.Selection causes error in Outlook Today

I have found an ugly hack

I check if I am in 'Outlook Today' folder:
IExplorer.CurrentFolder.Name FOutlookTodayFolder.Name

Strangely
IExplorer.CurrentFolder FOutlookTodayFolder
doesn't work for some reason

I get FOutlookTodayFolder like this:

NmSpace := OutlookApp.GetNamespace('MAPI');
Inbox := NmSpace.GetDefaultFolder(olFolderInbox);
FOutlookTodayFolder := Inbox.Parent as MAPIFolder;


  #3  
Old December 1st 06, 04:52 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Check for empty Explorer.Selection causes error in Outlook Today

You'd be better off comparing the entry ids rather than names.
The fact that (IExplorer.CurrentFolder FOutlookTodayFolder) is perfectly
normal. Each time you access Explorer.CurrentFolder, OOM returns a brand new
COM object.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Slava Barouline" slavadotbarouline@recruitmentsystemsdotcomdotau wrote in
message ...
I have found an ugly hack

I check if I am in 'Outlook Today' folder:
IExplorer.CurrentFolder.Name FOutlookTodayFolder.Name

Strangely
IExplorer.CurrentFolder FOutlookTodayFolder
doesn't work for some reason

I get FOutlookTodayFolder like this:

NmSpace := OutlookApp.GetNamespace('MAPI');
Inbox := NmSpace.GetDefaultFolder(olFolderInbox);
FOutlookTodayFolder := Inbox.Parent as MAPIFolder;




  #4  
Old December 3rd 06, 11:12 PM posted to microsoft.public.outlook.program_addins
Slava Barouline
external usenet poster
 
Posts: 15
Default Check for empty Explorer.Selection causes error in Outlook Today

I will probably use EntryID if
(IExplorer.CurrentFolderFOutlookTodayFolder) will not work

It shows different addresses for IExplorer.CurrentFolder and
FOutlookTodayFolder
How can I compare them?

"Dmitry Streblechenko" wrote in message
...
You'd be better off comparing the entry ids rather than names.
The fact that (IExplorer.CurrentFolder FOutlookTodayFolder) is
perfectly normal. Each time you access Explorer.CurrentFolder, OOM returns
a brand new COM object.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/



  #5  
Old December 4th 06, 05:35 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Check for empty Explorer.Selection causes error in Outlook Today

Compare entry ids.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Slava Barouline" slavadotbarouline@recruitmentsystemsdotcomdotau wrote in
message ...
I will probably use EntryID if
(IExplorer.CurrentFolderFOutlookTodayFolder) will not work

It shows different addresses for IExplorer.CurrentFolder and
FOutlookTodayFolder
How can I compare them?

"Dmitry Streblechenko" wrote in message
...
You'd be better off comparing the entry ids rather than names.
The fact that (IExplorer.CurrentFolder FOutlookTodayFolder) is
perfectly normal. Each time you access Explorer.CurrentFolder, OOM
returns a brand new COM object.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/





  #6  
Old December 5th 06, 01:45 AM posted to microsoft.public.outlook.program_addins
Slava Barouline
external usenet poster
 
Posts: 15
Default Check for empty Explorer.Selection causes error in Outlook Today

Thanks Dmitry

EntryIDs work fine

Why can't I compare Names?


"Dmitry Streblechenko" wrote in message
...
Compare entry ids.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool



  #7  
Old December 1st 06, 03:10 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Check for empty Explorer.Selection causes error in Outlook Today

Selection is probably empty because the OutlookToday folder is the top of
store and usually doesn't have items in it or anything selected.

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


"Slava Barouline" slavadotbarouline@recruitmentsystemsdotcomdotau wrote in
message ...
Hi guys

I have an explorer toolbar in my Add-in and when user presses buttons on
it, Add-in does something to a selected mail item.

When I am in Outlook Today, it doesn't work - for unknown reason the check
Assigned(IExplorer.Selection) raises an exception.

IExplorer is not empty.

Why is it so?

Thanks
Slava


  #8  
Old December 3rd 06, 11:10 PM posted to microsoft.public.outlook.program_addins
Slava Barouline
external usenet poster
 
Posts: 15
Default Check for empty Explorer.Selection causes error in Outlook Today

In a normal folder Selection is never nil, even if it's empty

When I try to access IExplorer.Selection for Outlook Today, it's not empty -
I get an error
Probably Selection is invalid for Outlook Today

"Ken Slovak - [MVP - Outlook]" wrote in message
...
Selection is probably empty because the OutlookToday folder is the top of
store and usually doesn't have items in it or anything selected.



 




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
Internet Explorer Script Error 'hoverEdit' is undefined robin Outlook Express 5 November 6th 06 11:14 PM
Calendar error in the Outlook Today setting. HKHAIA Outlook - Calandaring 0 October 17th 06 01:28 PM
Explorer.exe -Application Error Dirving Outlook - Installation 1 July 5th 06 05:36 PM
Outlook 2007 Spell Check Error Jim B Outlook - Installation 0 June 7th 06 11:39 PM
Outlook Express won't check for new messages, getting this error! psongman Outlook Express 12 January 21st 06 03:22 AM


All times are GMT +1. The time now is 07:02 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.