I use the following code to access PST files(not mounted in Outlook 2000) as
addstore, but it still pop up a mesage box.
Ask me to select one or ten minutes to access outlook. I could not disable it.
---
Sub Main()
strWorkingFolder = WScript.Arguments(0)'GetFileDir("Please select the PST
files folder")
If Not IsNull(strWorkingFolder) And Len(strWorkingFolder)>0 Then
'Get the files from the chosen folder and process all PST files
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWorkingFolder = objFSO.GetFolder(strWorkingFolder)
Set colFiles = objWorkingFolder.Files
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNameSpace("MAPI")
Dim objFile
cntSeries=100000
For Each objFile In colFiles
If UCase(objFSO.GetExtensionName(objFile.Path)) = "PST" Then
strDestination = Mid(objFile.Path,1,InStrRev(objFile.Path,".")-1)
If Not objFSO.FolderExists(strDestination) Then
objFSO.CreateFolder(strDestination)
End If
strLogFile = strDestination & "\ExportLog.txt"
objNS.AddStore objFile.Path
Set objNewFolder = objNS.Folders.GetLast
ProcessFolder objNewFolder
WriteToLog strLogFile,"Processing File " & objFile.Name & "Completed
normally."
'Set objFSO = CreateObject("Scripting.FileSystemObject")
'Set objFile = objFSO.CreateTextFile
(Replace(objFile.Path,objFile.Name,"mail.txt" )
'objFile.Close
'Err.Clear
'? why fore remove
objNS.RemoveStore objNewFolder
End If
'Set objFile = Nothing
Next
Set objNewFolder = Nothing
Set objNS = Nothing
MsgBox "All files processed!" & vbCrLf & "Files are located in
subfolders of the selected folder." & vbCrLf & "View the logfile in each PST
files folder to see any errors."
Else
MsgBox "No PST files in the folder selected!"
End If
Set objFolder = Nothing
Set objNewFolder = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Sub