'=================================================================== 'Description: VBS script to import eml-files. ' 'Comment: Before executing the vbs-file, make sure that Outlook is ' configured to open eml-files. ' Depending on the performance of your computer, you may ' need to increase the Wscript.Sleep value to give Outlook ' more time to open the eml-file. ' ' author : Robert Sparnaaij ' version: 1.1 ' website: http://www.howto-outlook.com/howto/import-eml-files.htm '=================================================================== 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.Name, 4) = ".eml" AND Item.IsFolder = False Then objShell.ShellExecute Item.Path, "", "", "open", 1 WScript.Sleep 1000 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