Folder size

  • Thread starter Thread starter Excelerate-nl
  • Start date Start date
E

Excelerate-nl

I have made a script to do a back-up in separate msg files of a selectable
Outlook folder (and its sub-folders). I would like to know the folder size in
Kb (like in the Properties Menu --> General --> Folder size) and the total
number of messages of the selected folder and it's sub-folders, so I can show
in in the interface form.

Thanks
 
For number of items in a folder you use code like this, where oFolder is the
folder:

count = oFolder.Items.Count

You would have to enumerate each subfolder and get its Items.Count for the
totals.

There's no property in the Outlook object model to tell you the folder size
like you see in the UI. If you get each item in the folder and get its Size
property and sum the values you can get a rough approximation of the folder
size. That only includes visible items in the folder however. There are also
hidden items in the folder (folder views and so on) that wouldn't be counted
that way.

If you use a lower level API such as Extended MAPI (C++ or Delphi only) or
Redemption (www.dimastr.com/redemption) or CDO 1.21 you can get the
associated items table (hidden items) and can count each hidden item's size
and add that to the size value for visible items to get a much better folder
size approximation.
 
Back
Top