3 Methods to Import Emails from a Windows Folder to Your Outlook

Perhaps you’ve saved several Outlook emails in your Windows folder. Now, if you want to import them back to an Outlook folder, how can you do it? This article will teach you 3 ways.

As we all know, Outlook provides a built-in option – “Save As”, by which you can save the emails to Windows folder. However, there is no feature for you to re-add the exported emails back to the Outlook folder. Therefore, if you would like to import the Outlook emails back to Outlook, how can you realize it? In the followings, we will teach you 3 methods. You can choose any as per your preference.

3 Methods to Import Emails from a Windows Folder to Your Outlook

Method 1: Drag & Drop to Import

  1. At the very outset, you need to access the source Windows folder which is storing the Outlook emails to be imported to Outlook.
  2. Then, launch your Outlook application.
  3. Next open the Outlook folder which you want to import the emails to.
  4. Subsequently, you need to narrow both the Windows folder window and Outlook window until you can view them in the meantime.
  5. After that, in the Windows folder, you can select one of the Outlook emails and then press “Ctrl + A” to select all of them.
  6. Later you can drag and drop the selected emails to the visible Outlook folder, like the following screenshot:Drag and drop the selected emails to the visible Outlook folder
  7. Finally, you will see that all the Outlook emails have been imported from the Windows folder to the Outlook folder, shown as the image below:Method 1 Effect: Emails Imported into Outlook

Method 2: Use “CreateItemFromTemplate” in VBA

  1. To start with, in the main Outlook window, press “Alt + F11” key buttons.
  2. Next you will get access to Outlook VBA editor window.
  3. Then copy the following VBA code into a blank module.
Sub ImportAllOutlookEmailsfromLocaltoOutlook1()
    Dim objFileSystem As Object
    Dim strLocalFolderPath As String
    Dim objLocalFolder As Object
    Dim objTargetFolder As Outlook.Folder
    Dim objFiles As Object
    Dim objFile As Object
    Dim strFileType As String
    Dim objItem As Object
 
    Set objFileSystem = CreateObject("Scripting.FileSystemObject")
 
    strLocalFolderPath = strSelectedFolder("")
    Set objLocalFolder = objFileSystem.GetFolder(strLocalFolderPath)
    Set objFiles = objLocalFolder.Files
 
    'Set the target Outlook folder
    Set objTargetFolder = Session.GetDefaultFolder(olFolderInbox).folders("Ago")
 
    For Each objFile In objFiles
        strFileType = objFileSystem.GetExtensionName(objFile)
  
        If strFileType = "msg" Then
           Set objItem = Outlook.Application.CreateItemFromTemplate(objFile.Path)
 
           objItem.Move objTargetFolder
           'Delete the source file in the Windows folder
           'objFileSystem.DeleteFile (objFile.Path)
        End If
    Next
End Sub

Function strSelectedFolder(strStartFolder As String) As String
    Dim objShell As Object
    Dim objFolder As Object
 
    On Error Resume Next
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.BrowseForFolder(0, "Select the source folder:", 0, strStartFolder)
 
    strSelectedFolder = objFolder.self.Path
End Function

VBA Code - Import via CreateItemFromTemplate

  1. Next you can press F5 key button in the current module window to start the macro.
  2. After that, you need to browse to the source Windows folder in the popup dialog box.
  3. Lastly, after selecting source folder, all the Outlook items in that folder will be import into the predefined Outlook folder.
  4. Note: in this way, the imported emails are all fresh new emails, which you can compose at will, like the following screenshot:Method 2 Effect: Emails Imported into Outlook

Method 3: Utilize “OpenSharedItem” in VBA

  1. Like the Method 2, copy the following VBA codes into another module.
Sub ImportAllOutlookEmailsfromLocaltoOutlook2()
    Dim objFileSystem As Object
    Dim strLocalFolderPath As String
    Dim objLocalFolder As Object
    Dim objTargetFolder As Outlook.Folder
    Dim objFiles As Object
    Dim objFile As Object
    Dim strFileType As String
    Dim objItem As Object
    Dim objCopiedItem As Outlook.MailItem

    Set objFileSystem = CreateObject("Scripting.FileSystemObject")
 
    strLocalFolderPath = strSelectedFolder("")
    Set objLocalFolder = objFileSystem.GetFolder(strLocalFolderPath)
    Set objFiles = objLocalFolder.Files
 
    'Set the target Outlook folder
    Set objTargetFolder = Session.GetDefaultFolder(olFolderInbox).folders("Ago")
 
    For Each objFile In objFiles
        strFileType = objFileSystem.GetExtensionName(objFile)
 
        If strFileType = "msg" Then
           Set objItem = Session.OpenSharedItem(objFile.Path)
           'Only import emails
           If TypeOf objItem Is MailItem Then
              Set objCopiedItem = objItem.Copy
              objCopiedItem.Move objTargetFolder
              'Delete the source file in the Windows folder
              'objFileSystem.DeleteFile (objFile.Path)
           End If
       End If
    Next
End Sub

Function strSelectedFolder(strStartFolder As String) As String
    Dim objShell As Object
    Dim objFolder As Object
 
    On Error Resume Next
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.BrowseForFolder(0, "Select the source folder:", 0, strStartFolder)
 
    strSelectedFolder = objFolder.self.Path
End Function

VBA Code - Import via OpenSharedItem

  1. Then run this macro by hitting “F5” key button.
  2. Next select the source folder.
  3. Eventually all the emails will be imported as the image below:Method 3 Effect: Emails Imported into Outlook

Comparisons

Methods Advantages Disadvantages
Method 1 It is easier to be accepted for those who aren’t familiar with VBA. This demands you to narrow the two windows until you can see both.
Method 2 You can use the imported emails as fresh new emails, which you can compose and send at will. If there are other Outlook items saved with “.msg” format in the Windows folder, such as contacts or tasks, this way will import them too.
Method 3 It can recognize Outlook emails precisely and escape other Outlook items. By this means, you are unable to compose and send the imported emails as easily as the Method 2.

Means to Block PST Data Corruption

As we all know, Outlook comes preinstalled with an inbuilt tool – Scanpst. Most of time, it is capable of solving small problems. However, if the issues are blazing severe, the built-in tool will tend to fail. So, you had better recur to a more potent tool, such as DataNumen Outlook Repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including SQL Server corruption and outlook repair software products. For more information visit www.datanumen.com