Rename a PST within Outlook

Is there a program or script that can rename PST's.  When I open a PST in Outlook through File>Open>Outlook Data File... The PST opens as "Personal Folders" and of course I can go to the Properties, Advanced and rename it in the Name field but I have a few hundred I need to do and would prefer not to do this manually.
Who is Participating?
KimputerConnect With a Mentor Commented:
This should help you along:

Sub test()

Dim objOutlook As Object
Dim objNameSpace As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objNameSpace = objOutlook.GetNamespace("MAPI")
For Each Folder In objNameSpace.Folders
    If Folder.Name = "Personal Folders" Then
        Folder.Name = "xxx"
    End If
End Sub

Open in new window

Potentially, you could open ALL pst files in a folder, and have them renamed based on the filename of the PST file.
It has to be named "Personal Folders" already though, and no other PST file should be open.
Alexei Kuznetsov (Outlook MVP)CEOCommented:
What is the rule for renaming?
What is the reason behind opening hundreds of PST files?
helpdesk_compsychAuthor Commented:
Recovering mailbox data
QlemoConnect With a Mentor DeveloperCommented:
Then probably the approach by using the filename in a VBA macro is the best.
All Courses

From novice to tech pro — start learning today.