システムwiki

pstファイルをバッチで追加する方法

JichLi 解決済 最終更新日:2020-12-07 14:55

会社のメールボックスサーバーは容量が小さいため、多くのPSTファイルが四半期ごとにアーカイブされます.システムを再インストールするか、新しいメールボックスプロファイルを作成した後、毎回手動でPSTファイルを追加する必要がありますが、outlookクライアントは1つずつしか追加できないため、非常に非効率的です.ローカルPSTファイルをバッチで追加するにはどうすればよいですか?

返信リスト(回答:2)

1 #
Elvisse 2
Outlook?alt + F11????VBA???????????????????(2???E:\?pst????????????????)??????BatchOpenMultiplePSTFiles()?????
Sub BatchOpenMultiplePSTFiles()
Call LoopF??olders( "E:\")
MsgBox "Open Successfully?"?vbExclamation + vbOKOnly ??Outlook???????????
End Sub
Sub LoopF??olders(strPath As String)
Dim objFileSystem As Object
Dim objFolder As Object
Dim objFile As Object
Dim objPSTFile As Object
Set objFileSystem=CreateObject( "Scripting.FileSystemObject")
Set objFolder=objFileSystem.GetFolder(strPath)
?objFile In objFolder.Files
strFileExtension=objFileSystem.GetExtensionName(objFile)
If LCase(strFileExtension)= "pst" Then
Set objPSTFile=objFile
Outlook.Application.Session.AddStore(objPSTFile.Path)
End If
?
If objFolder.SubFolders.Count>0 Then
objFolder.SubFolders??objSubFolder????
If((objSubFolder.Attributes And 2)=0)And((objSubFolder.Attributes And 4)= 0)Then
LoopF??olders(objSubFolder.Path)
End If
Next
End If
End Sub

??????????????????????????????????????????????????????????????
2 #
MarkLam
???????????????
PST??????????????????????????
??????????????????
support.Microsoft.com/ja-jp/help...