Wednesday, 23 July 2014

VBScript to automatically map PST files into Outlook


Edit Set objFolder = objFSO.GetFolder("H:\PST")to suit your requirements:

**********************

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objnet = CreateObject("wscript.network")

Set olkApp = CreateObject("Outlook.Application")

Set objFolder = objFSO.GetFolder("H:\PST")

For Each objFile In objFolder.Files

   If LCase(objFSO.GetExtensionName(objFile.Name)) = "pst" Then

     olkApp.Session.AddStore objFile.Path

   End If

Next

1 comment: