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 » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Determining Selected Mail Items



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 20th 07, 05:14 PM posted to microsoft.public.outlook.program_vba
DENNIS BROWN
external usenet poster
 
Posts: 51
Default Determining Selected Mail Items

If I want to use VBA to get the count and text of selected items within the current folder, what would be some syntax possibilities?
For example, the user selects items 1, 7, 12, 17, 21, 23-29, and 35, in preparation to take an action on those items (i.e. delete, move, etc.), how would I get the count, and the text to those items, if I wanted to save the count and text in a couple of variables for future use?

--

Thanks,
Dennis
Ads
  #2  
Old June 20th 07, 06:35 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Determining Selected Mail Items

Application.ActiveExplorer.Selection is the collection of all selected items. Selection.Count gives you the count. Iterate the collection to return each item in turn. If you plan to move or delete, use a countdown For ... Next loop.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"DENNIS BROWN" wrote in message . ..
If I want to use VBA to get the count and text of selected items within the current folder, what would be some syntax possibilities?
For example, the user selects items 1, 7, 12, 17, 21, 23-29, and 35, in preparation to take an action on those items (i.e. delete, move, etc.), how would I get the count, and the text to those items, if I wanted to save the count and text in a couple of variables for future use?

--

Thanks,
Dennis
  #3  
Old June 21st 07, 07:55 PM posted to microsoft.public.outlook.program_vba
DENNIS BROWN
external usenet poster
 
Posts: 51
Default Determining Selected Mail Items

Works great! Thanks.

--

Thanks,
Dennis
"Sue Mosher [MVP-Outlook]" wrote in message ...
Application.ActiveExplorer.Selection is the collection of all selected items. Selection.Count gives you the count. Iterate the collection to return each item in turn. If you plan to move or delete, use a countdown For ... Next loop.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"DENNIS BROWN" wrote in message . ..
If I want to use VBA to get the count and text of selected items within the current folder, what would be some syntax possibilities?
For example, the user selects items 1, 7, 12, 17, 21, 23-29, and 35, in preparation to take an action on those items (i.e. delete, move, etc.), how would I get the count, and the text to those items, if I wanted to save the count and text in a couple of variables for future use?

--

Thanks,
Dennis
 




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
Iterating through multiple items selected in a mailbox dch3 Outlook and VBA 2 June 8th 07 04:05 PM
Outlook Limit of 100 Selected Mail Items? [email protected] Outlook - General Queries 0 May 17th 07 03:35 PM
selected receiver of mail armando Outlook - Using Forms 1 December 15th 06 12:17 AM
showing only selected items in a shared group calendar Christine Outlook - Calandaring 3 August 16th 06 09:22 PM
Outlook 2003 doesn't show number of selected items RD Outlook - Installation 1 March 2nd 06 10:47 PM


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