그래서 이번 포스트는 그 버그 픽스를 남겨 놓을려고 한다.
Dim objShell : Set objShell = CreateObject("Shell.Application")
Dim objFolder : Set objFolder = objShell.BrowseForFolder(0, "Select the folder containing eml-files", 0)
Dim Item
Dim i : i = 0
If (NOT objFolder is Nothing) Then
Set WShell = CreateObject("WScript.Shell")
Set objOutlook = CreateObject("Outlook.Application")
Set Folder = objOutlook.Session.PickFolder
If NOT Folder Is Nothing Then
For Each Item in objFolder.Items
If Right(Item.Path, 4) = ".eml" AND Item.IsFolder = False Then
objShell.ShellExecute Item.Path, "", "", "open", 1
WScript.Sleep 500
Set MyInspector = objOutlook.ActiveInspector
Set MyItem = objOutlook.ActiveInspector.CurrentItem
MyItem.Move Folder
i = i + 1
End If
Next
MsgBox "Import completed." & vbNewLine & vbNewLine & "Imported eml-files: " & i & _
vbNewLine & "Imported into: " & Folder.FolderPath, 64, "Import EML"
Set Folder = Nothing
Else
MsgBox "Import canceled.", 64, "Import EML"
End If
Else
MsgBox "Import canceled.", 64, "Import EML"
End If
Set objFolder = Nothing
Set objShell = Nothing