Determining the size of a pst file using CDO

  • Thread starter Thread starter Jill
  • Start date Start date
J

Jill

I am writing an outlook application that stores messages into a PST
file I created. I know that PST files have size limits of about 2GB
and would like to try to manage the size of my file to prevent it from
going over this limit and becoming corrupted. Is there any way I can
programmatically determine the size of a PST file (i.e. a "Personal
Folders" InfoStore)? Or is there a way that I can check the amount of
space left in the file?

I know that it is possible to check the size of the Mailbox InfoStore
using the InfoStore.Fields(PR_MESSAGE_SIZE) function. However, this
does not seem to work with the pst file InfoStore that I have added. I
checked using Outlook Spy, and it seems that the infoStore I created
does not have this property by default.

Any suggestions?
 
Just a thought here, but why use CDO at all? Why not just read the file size
using a Windows API call?

Gary McDonnell
TurboGeeks


I am writing an outlook application that stores messages into a PST
file I created. I know that PST files have size limits of about 2GB
and would like to try to manage the size of my file to prevent it from
going over this limit and becoming corrupted. Is there any way I can
programmatically determine the size of a PST file (i.e. a "Personal
Folders" InfoStore)? Or is there a way that I can check the amount of
space left in the file?

I know that it is possible to check the size of the Mailbox InfoStore
using the InfoStore.Fields(PR_MESSAGE_SIZE) function. However, this
does not seem to work with the pst file InfoStore that I have added. I
checked using Outlook Spy, and it seems that the infoStore I created
does not have this property by default.

Any suggestions?
 
The problem with using the Windows API to determine the pst file size
is that pst files do not shrink when items are deleted from them. So
if I delete messages from my pst file, there will be free space left in
the file, but the size of the file on disk will be the same as it was
before the messages were deleted. I believe that even though this
space has not been freed on disk, it is free space in the pst file and
will be reused as I store more messages in the pst file. (Let me know
if I am wrong about this!) So I need a CDO (or even MAPI) call to
figure out how much space is actually used in the pst file.

Jill
 
The problem with using the Windows API to determine the pst file size
is that pst files do not shrink when items are deleted from them. So
if I delete messages from my pst file, there will be free space left in
the file, but the size of the file on disk will be the same as it was
before the messages were deleted. I believe that even though this
space has not been freed on disk, it is free space in the pst file and
will be reused as I store more messages in the pst file. (Let me know
if I am wrong about this!) So I need a CDO (or even MAPI) call to
figure out how much space is actually used in the pst file.

Jill
 
Back
Top