Building on, this code will remove the mapping that has been done in outlook for ALL PST files.
'On Error resume next
Dim objOutlook 'As Outlook.Application
Dim Session 'As Outlook.NameSpace
Dim Store 'As Outlook.Store
Dim Stores 'As Outlook.Stores
Dim objFolder 'As Outlook.Folder
Set objOutlook = CreateObject("Outlook.Application")
Set Session = objOutlook.Session
Set Stores = Session.Stores
For Each Store In Stores
If Store.ExchangeStoreType = 3 then
Set objFolder = store.GetRootFolder
I get an error line 10 char 1 Object doesn't support this property or method: 'Stores'
Odd... Do you have outlook installed on your pc? Script was tested on outlook 2003 and 2010 so something must be going on in your environment...
It works except it skipped every other PST file
This script uses a For Each-statement to traverse the list, but inside the loop items may be removed. The element after the deleted one will never be tested for deletion.
See this page for a better script: techblog.se/.../script-fr-att-stnga-alla-ppna-pst-filer
Work with pst files by outlook 2007 ost repair
this is cool but only runs when outlook is closed