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

Find number of sub Folders



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 3rd 08, 10:52 PM posted to microsoft.public.outlook.program_vba
Marks
external usenet poster
 
Posts: 3
Default Find number of sub Folders

Hi,
I need to find a sub folder on different machine, which always has the same
Name. I have got this far

Set SourceFolder = mynamespace.Folders("Personal Folders")
For iLoopCounter = 1 To Something
If SourceFolder.Folders(iLoopCounter) = "AFMA" Then
Set TargetFolder = SourceFolder.Folders(1)
iLoopCounter = Something + 1
End If
Next

I need to know what to put in place of something to get the number of sub
folders that exist

Thanks
  #2  
Old February 3rd 08, 11:59 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Find number of sub Folders

You're making it too hard. Because folder names are unique in each collection, you can get the folder directly:

TargetFolder = SourceFolder.Folders("AFMA")

If you really needed the number of folders, that would be returned by the Folders.Count property. Remember, the object browser is your friend.

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


"MarkS" wrote in message ...
Hi,
I need to find a sub folder on different machine, which always has the same
Name. I have got this far

Set SourceFolder = mynamespace.Folders("Personal Folders")
For iLoopCounter = 1 To Something
If SourceFolder.Folders(iLoopCounter) = "AFMA" Then
Set TargetFolder = SourceFolder.Folders(1)
iLoopCounter = Something + 1
End If
Next

I need to know what to put in place of something to get the number of sub
folders that exist

Thanks

 




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
Can't find a phone number that is in Phone Number Field? Mark Outlook - Using Contacts 1 November 8th 06 08:04 PM
Integrate week number calender - hard to find now Thure Outlook - Calandaring 1 September 14th 06 11:46 AM
How do I find out the number of contacts in a distribution list i KathyB Outlook - Using Contacts 2 May 25th 06 02:01 PM
Find a contact by telephone number Angus Comber Outlook and VBA 3 April 7th 06 04:05 PM
How do I find the number of email addresses in a distribution list Shockle Outlook - Using Contacts 1 January 30th 06 10:13 PM


All times are GMT +1. The time now is 03:38 PM.


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.