Two Questions about handling a .PST file via VBA

W

Wassim

Hello All

I have two questions about handling a MS-Outlook 2003 .PST file via
VBA from MS-Outlook:

1) Is there a way to compact a .PST file via VBA? What I need to do is
strip all attachments from messages, and then compact the .PST file.
This is to save disk space on a weekly basis.

2) Is there a way to create a new .PST file via VBA while MS-Outlook
2003 is still running? What I am thinking about is to move the current
..PST file to a certain folder, then start a new fresh .PST file in its
place.

Thanks for any help.

Wassim
 
K

Ken Slovak - [MVP - Outlook]

1) No. You can't compact using code.

2) Not really. You can create a new PST or open an existing one using the
AddStore method but using RemoveStore to close a PST won't unlock it and you
can't change the default PST for a profile while Outlook is running.
 
W

Wassim

Thank You Ken

Any news about the up coming Outlook version if this will be doable?
Compacting a .PST file via VBA code?

Also, if I am not an MVP will Microsoft consider my request if I send
it via the wish list?

I have some "great" ideas for Outlook VBA, or maybe I should ask an
MVP to post them on my behalf.

Thanks again.

Wassim
 
K

Ken Slovak - [MVP - Outlook]

I've heard of no plans to make compacting accessible in any version of
Outlook, but Outlook 12 is a long way away, so who knows? We (the developer
Outlook MVP's) have requested that anything accessible in the UI or with CDO
1.21 or Extended MAPI be made accessible using the Outlook object model in
Outlook 12, but only time will tell if that happens.

You can write to (e-mail address removed) and make any suggestions you want.
Just place "Outlook" as part of the subject. The Outlook team reads those
and if enough people ask for a feature and they can make a business case for
adding it then you might get lucky.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top