回复 6# wsfda
#include <Array.au3>
$asPSTPath = _GetPSTPath()
If $asPSTPath[0] > 1 Then MsgBox(0,'',$asPSTPath[1]) ;路径 1
If $asPSTPath[0] > 2 Then MsgBox(0,'',$asPSTPath[2]) ;路径 2
If $asPSTPath[0] >= 3 Then MsgBox(0,'',$asPSTPath[3]) ;路径 3
;If IsArray($asPSTPath) Then _ArrayDisplay($asPSTPath)
Func _GetPSTPath()
Local $sFolderSubString, $sPath, $asPathSearch, $sReturn
Local $oOutlook = ObjCreate("Outlook.Application")
Local $oNS = $oOutlook.GetNamespace("MAPI")
If IsObj($oNS) Then
For $objFolder In $oNS.Folders
$sPath = ""
For $i = 1 To StringLen($objFolder.StoreID) Step 2
$sFolderSubString = StringMid($objFolder.StoreID, $i, 2)
If $sFolderSubString <> "00" Then $sPath &= Chr(Dec($sFolderSubString))
Next
$asPathSearch = StringRegExp($sPath, "(?i)\w(:\\|\\\\)\w.*[pst]", 2)
If IsArray($asPathSearch) Then $sReturn &= $asPathSearch[0] & Chr(28)
Next
Return StringSplit(StringTrimRight($sReturn, 1), Chr(28))
Else
SetError(1)
Return 0
EndIf
EndFunc
|