[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Outlook 2010 folder count

Posted on 2014-03-07
5
Medium Priority
?
6,510 Views
Last Modified: 2014-03-31
Hi-

Is there a way to calculate the number of folders / sub-folders in an Outlook 2010, connecting to Exchange 2010 server?

Is there a limit beyond which to expect performance issues?
0
Comment
Question by:paullord
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 13

Accepted Solution

by:
Chris Raisin earned 2000 total points
ID: 39914235
I have been advised by others (and I quote these statistics based on their advice) that early versions of the Exchange client supported 16,000 items per folder. However Outlook (with large table support enabled) supports about 65,000 items per folder. This is the default for new pst’s created ever since Outlook98.

Outlook 2003 with a Unicode format *.pst or *.ost can have an unlimited number of items.

In all cases these limits apply to all folder types. Especially note that subfolders count as ‘items’, so you could have 60000 folders and 5,000 messages, with each of the 60,000 folders containing 65,000 messages, at least until you hit the ANSI pst size limit of 2GB.

The good news is Exchange mailboxes are not affected by these limits, except when using them offline (so I'm told).

Be aware though that as your folders and mailbox grow Outlook WILL slow down, so, while you can have 65,000 contacts, it might be an idea to keep below that figure otherwise things may grind to a halt.

As far as calculating the number of folders you have, the following bit of code I have just written will probably help. Place it in your VBA editor then run the macros "CountFoldersInOutlook"
and "CountItemsInOutlook". I have not verified the numbers derived as being correct (but you may be able to tell from your results).

Public Sub CountFoldersInOutlook()

Dim outapp As Outlook.Application
Set outapp = CreateObject("Outlook.Application")
Dim olns As Outlook.NameSpace
Set olns = outapp.GetNamespace("MAPI")

MsgBox "Total Folders: " & GetSubFolderCount(olns.GetDefaultFolder(olFolderInbox).Parent)

End Sub

Private Function GetSubFolderCount(objParentFolder As MAPIFolder) As Long

Dim currentFolders As Folders
Dim fldCurrent As MAPIFolder

Set currentFolders = objParentFolder.Folders
If currentFolders.Count > 0 Then
   Set fldCurrent = currentFolders.GetFirst
   While Not fldCurrent Is Nothing
      TempFolderCount = TempFolderCount + GetSubFolderCount(fldCurrent)
      Set fldCurrent = currentFolders.GetNext
   Wend
   GetSubFolderCount = TempFolderCount + currentFolders.Count
Else
    GetSubFolderCount = 0
End If

End Function

Public Sub CountItemsInOutlook()

    Dim objOutlook As Object, objnSpace As Object, objFolder As MAPIFolder, objSubFolder As MAPIFolder
    
    Dim EmailCount As Integer
    Dim nFolder as Long, nFolders as Long, nSubFolders as Long, nSubFolder as Long
    Set objOutlook = CreateObject("Outlook.Application")
    Set objnSpace = objOutlook.GetNamespace("MAPI")

        nFolders = objnSpace.Folders.Count
        
        For nFolder = 1 To nFolders
          Set objFolder = objnSpace.Folders(nFolder)
          nSubFolders = objFolder.Folders.Count
          For nSubFolder = 1 To nSubFolders
            Set objSubFolder = objFolder.Folders(nSubFolder)
            nItems = nItems + objSubFolder.Items.Count
          Next
        Next
     

    EmailCount = nItems

    MsgBox "Total number of items (all folders) : " & CStr(nItems)
   
End Sub

Open in new window

0
 
LVL 44

Expert Comment

by:Davis McCarn
ID: 39914549
Or, right-click on the Personal Folders at the top of the folder tree, choose properties, then click the folder size button.
2010, BTW, is the first version that will compact the PST/OST automatically if left running in the background; but, users still need to empty their delete items and junk folders.
0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 39914559
Sorry. I thought you were after code. My mistake.

Still it will be handy for those who DO want code! :-)
0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 39917425
I did however answer the second part of your question re limits. I hope the code comes in handy. :-)
Cheers
Chris (craisin) - Australia
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I don't pretend to be an expert at this, but I have found a few things that are useful. I hope that sharing them here will help others, so they will not have to face some rather hard choices. Since I felt this to be a topic of enough importance and…
On September 18, Experts Exchange launched the first installment of the Help Bell, a new feature for Premium Members, Team Accounts, and Qualified Experts. The Help Bell will serve as an additional tool to help teams increase question visibility.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question