Outlook Folder Size

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm sure this has been asked before, but I couldn't find it.

How do you get the size of an Outlook folder in VBA? Right now I'm
iterating through all the items in the folder, and that is waaaaayyyyy too
slow.

Thanks!
 
You can use CDO 1.21 to access the PR_MESSAGE_SIZE of a folder object. But
what's wrong with the way you are doing it now? It can't take THAT long.
CDO is also quicker for iterating through large collections.
 
Thanks, I'll try the CDO option. To me, anything that takes more than a
second is too long! The utility I'm building summarizes all the folders in
my Outlook session, including number of items, unread items, and sizes.
Getting the folder sizes makes the operation go from about 2 seconds to about
100 seconds (I have a lot of folders and items).
 
How about build a Search Folder that encompasses all the folders that you
need to report the size on. Then use CDO or Redemption to get a handle to
the folder, and loop through the items it returns. As long as you touch the
Search Folder before hand so that it is fairly recent (it builds the index on
a frequency that I don't know), it may save you time.

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
 
Back
Top