![]() |
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 |
#2
|
|||
|
|||
![]() If you want to handle one item only, there's no need to loop through all the collection. Instead, just work with Selection(1). But I suppose what takes long is accessing the commandbar button, and that's the code we don't see. If it's always the same button, keep its reference, so you don't need to find it again and again. -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Sun, 11 Oct 2009 01:54:01 -0700 schrieb paresh: Hi, I have noticed some issues with handling explorer change event when mailbox is large. I have Outlook add-in which handles explorer change event like below and displays senders name as a button caption which is created on Outlook toolbar. It takes long sometimes to change the caption button. Could you tell me how could I optimize the single email item selection event? Thanks, Paresh My code: Private WithEvents objExpl As Outlook.Explorer Friend Sub InitHandler(olApp As Outlook.Application, strProgID As String) Set objExpl = objOutlook.ActiveExplorer 'Explorer Object End Sub Private Sub objExpl_SelectionChange() If objExpl.Selection.Count 0 Then For Each objMailItem In objExpl.Selection If objMailItem.Class = olMail Then msgbox "email item"; End If Next End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
MSG File - Trap Explorer Selection Change Event | DG | Outlook and VBA | 8 | January 11th 10 09:03 AM |
On click event for mail item selection | Mark | Outlook and VBA | 4 | December 15th 08 02:31 AM |
Slow performance while accessing Outlook item fields using VSTO | Maxim | Add-ins for Outlook | 3 | November 16th 06 03:08 PM |
Which event is triggered when user saves email item? | Kasper | Add-ins for Outlook | 4 | September 22nd 06 02:26 PM |
how to improve performance of Outlook | Raj Menon | Outlook - Installation | 3 | February 27th 06 03:25 PM |