Re: Checking folder size

  • Thread starter Thread starter Ken Slovak - [MVP - Outlook]
  • Start date Start date
K

Ken Slovak - [MVP - Outlook]

You can use the folder property PR_MESSAGE_SIZE in CDO 1.21 code to
get the approximate size of the folder. Some hidden messages for
rules, archive settings and so on might not be tabulated in that
property, I'm not sure about that. CDO property tags are listed at
http://www.cdolive.com/cdo10.htm and there's CDO sample code at
http://www.cdolive.com/cdo5.htm.

CDO 1.21 is an optional installation for Outlook 2000 and later, so
you might have to install CDO from the Office CD as an Outlook
optional feature if you don't already have it installed.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 
I have looked at the CDO object but can not find the
property that would provide the folder size. Any idea
what it may be?

Thanks
-----Original Message-----
As I said, you can use CDO for that. There's nothing in the Outlook
object model that will give you what you want.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


mosow said:
Thanks for the info, but I don't seem to be able to get
the folder size. Below is a VBScript I have to go
through the folders. I am trying to get the folder size
without having to use Outlook and check each and every
folder and write down it's size.

Option Explicit

On Error Resume Next

Dim appOutlook
Dim mapiNameSpace
Dim objFolders
Dim objFolder
Dim objSubFolders
Dim objSubFold

Set appOutlook = CreateObject("Outlook.Application")
Set mapiNameSpace = appOutlook.GetNameSpace("MAPI")

Set objFolders = mapiNameSpace.Folders
For Each objFolder in objFolders
MsgBox "Mapi folder: " & objFolder.Name
Set objSubFolders = objFolder.Folders
For each objSubFold in objSubFolders
MsgBox "Subfolder: " & objSubFold.Name
Next
Next

Set objFolders = mapiNameSpace.Folders("Personal
Folders").Folders
For Each objFolder in objFolders
MsgBox "Personal folder: " & objFolder.Name
Next

Set objFolders = Nothing
Set objFolder = Nothing


.
 
Back
Top