none
Auto Set for pst size RRS feed

  • Question

  • Hi,Can we limit pst file to some limit.

    For eg, If my archive or any pst file reach 2 GB then it would automatically create for another PST.

    Wednesday, September 5, 2012 12:41 PM

Answers

All replies

  • If you want to do this with code it is possible.  In order to set restrictions on .pst size limits, I believe you need to set a Group Policy - consult the Office Resource Kit or ask here:

    Outlook IT Pro Discussions Forum:
    http://social.technet.microsoft.com/Forums/en-US/outlook/threads


    Eric Legault MVP (Outlook)
    About me...
    Try Outlook Appins - affordable and easy to use!

    Wednesday, September 5, 2012 2:21 PM
    Moderator
  • I don't know of a way to auto-rollover PST's like this that's built into Outlook.  If it exists, perhaps some of the other experts on here will know about it.  Would be a great feature, though!

    I don't know of a way to retrieve the total size of a PST file from within the Outlook object model, either.  One way to query PST filesize with VBA, though, would be with FileSystemObject and its related functionality:

    Function getMainPSTSize(s As Store) As Long
        Dim fs As FileSystemObject
        Dim fl As File
        
        Set fs = CreateObject("Scripting.FileSystemObject")
        Set fl = fs.GetFile(s.FilePath)
        
        getMainPSTSize = fl.Size
    End Function

    You'd also have to add code to an appropriate event handler, perhaps Application_Startup, that would poll the various Store objects in Session.Stores & check their filesizes.

    Unfortunately, I'm not sure you can dynamically create a new Store with the standard Outlook DOM, nor switch the default store location for an Outlook Account.  Perhaps Dmitri's Outlook Redemption exposes these functionalities?  In any event, you could just have the code alert you when the file size is above your threshold, and then manually roll over the PST(s).

    Wednesday, September 5, 2012 2:29 PM
  • Correct, there are no methods in the Outlook Object Model or Redemption to get the .pst file size with Store or RDOStore objects.  You can however easily create a new .pst file with the NameSpace.AddStore or AddStoreEx methods.

    Eric Legault MVP (Outlook)
    About me...
    Try Outlook Appins - affordable and easy to use!

    Wednesday, September 5, 2012 2:36 PM
    Moderator
  • Bah! Forgot to check NameSpace.  Thanks, Eric.

    Can you reassign the default delivery store dynamically via the OOM?  According to the documentation, Account.DeliveryStore is read-only.


    • Edited by Brian Skinn Wednesday, September 5, 2012 2:41 PM Add link
    Wednesday, September 5, 2012 2:40 PM
  • No problem Brian.  And you are correct - you'd have to use Redemption's RDOAccount.DeliverToStore to change it.

    Eric Legault MVP (Outlook)
    About me...
    Try Outlook Appins - affordable and easy to use!

    Wednesday, September 5, 2012 2:52 PM
    Moderator
  • But you can retrieve the PST file name from the RDOPstStire.PstPath property (http://www.dimastr.com/redemption/rdostore.htm#RDOPstStore), then use regulat file access API to retrieve the file size.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Wednesday, September 5, 2012 4:40 PM