Count property of "Outlook.Selection" object

Add-in Express™ Support Service
That's what is more important than anything else

Count property of "Outlook.Selection" object
 
Guest


Guest


Hi,

I am developing an add-in which process selected mail items.

I also would like display a warning message when user selects more than 1000 items, saying that process can be quite lengthy.

The problem is that, when user selects more than 1000 items, executing the Count property of the Outlook.Selection object takes around 15secs.

I guess method internally iterates through all selected items to count them.

Is there a walkaround for that?

It is funny to make the users wait for a message that tells them they have to wait..


1.Dim selectedItems As Outlook.Selection = activeExplorer.GetType().InvokeMember("Selection", _
Reflection.BindingFlags.GetProperty, Type.DefaultBinder, activeExplorer, New Object() {})

2.Dim selectedItemCount As Integer = selectedItems.Count

(Line 2 takes approx. 15 secs. to execute.)

Thanks in advance,
Serhat.

Posted 25 Dec, 2005 07:14:56 Top
Sergey Grischenko


Add-in Express team


Posts: 7230
Joined: 2004-07-05
Hi Serhat.

I have just tested this situation on my PC. It works in a moment.
I have tested it in Office 2003. What version of Office do you use?
Posted 26 Dec, 2005 18:12:49 Top
Guest


Guest


Thanks for your time,
I used it on Outlook 2000.

Posted 28 Dec, 2005 03:25:37 Top
Sergey Grischenko


Add-in Express team


Posts: 7230
Joined: 2004-07-05
Hi Serhat.

I have read about the similar problem in the Outlook groups. I think Outlook 2000 has limitation that doesn't allow you to select more
than the definite number of items.
Posted 29 Dec, 2005 10:15:17 Top