Item count in a PST file.

We need to be able to get a Count of ALL items in a PST file, size is irreverent.

VB Scripts are out of the question.

Is there any way to just get a tally of total items in a single PST file?
Who is Participating?
Chris BottomleyConnect With a Mentor Commented:
You can use the VBA to get the count for any folder ... you just need to specify the folder and then depending on yout outlook version will depend on just how flexible we can be ... but it is certainly doable as an outlook or stand alone script as shown above.

Chris BottomleyConnect With a Mentor Commented:
I believe the answer is you cannot without a script of some kind.

Note a script can be VBA within Outlook itself or even a stand alone script that does the job.  Assuming you are not allowed to add macros to outlook the use of a stand alone script may therefore meet your needs.

An example of a stand alone script is as follows ... save as something.vbs and then execute it by double clicking .. modify the relevant PST name on line 4 as appropriate.

    Set olkApp = CreateObject("outlook.application")
    Set fldr = olkApp.session.folders("Personal Folders")
    funItemCount fldr, itemcount, foldercount
    MsgBox "Count of Items :> " & itemcount & vbCrLf & "Count of Folders :> " &foldercount

Function funItemCount(fldr, itemcount, foldercount)
    itemcount = itemcount + fldr.Items.Count
    foldercount = foldercount + 1
    For Each subFolder In fldr.Folders
        funItemCount subFolder, itemcount, foldercount

End Function

Open in new window

yo_beeDirector of Information TechnologyCommented:
If vbs is out what method are you looking to use to accomplish this task?
BBDallasAuthor Commented:
I was hoping there was a PS command from part of Exchange PS aplets.  Or a way to use an exchange PS aplet to get to the same function without having to import the pst into exchange.

Or shot just a way in outlook to get counts, but it appears outlook only does a raw count for an exchange mailbox.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.