2 Means to Batch Import Multiple Plain Text Files as Separate Outlook Notes

Some users hope to batch import multiple Plain Text files into Outlook as separate note items. This post will look at this requirement to expose 2 methods to achieve it.

It is very easy to export the Outlook notes as Plain Text files via the simple “Save As” feature. Then, what about importing the Plain Text files as notes? There is not such a native function supporting such “Import”. Hence, here we will teach you 2 means to achieve it.

Method 1: Copy the Contents of Plain Text Files to Notes Manually

  1. First off, open a Plain Text file.
  2. Next, copy the contents in the text file.Copy Plain Text File Content
  3. After that, create a new note in Outlook.
  4. Then, paste the contents of the text file into the note.Paste Copied Text File Content
  5. Now, use this way to copy the contents of the other Plain Text files into notes.

Method 2: Batch Import Multiple Plain Text Files as Notes via VBA

  1. For a start, move the source Plain Text files into the same local folder.
  2. Then, start Outlook application.
  3. Next, trigger Outlook VBA editor according to “How to Run VBA Code in Your Outlook“.
  4. Subsequently, put the following VBA code into an unused module.
Sub BatchImportPlainTextFilesAsNotes()
    Dim strLocalFolder As String
    Dim objFileSystem As Object
    Dim objFolder As Object
    Dim objFile As Object
    Dim strFileExtension As String
    Dim objTextStream As Object
    Dim strText As String
    Dim objNote As Outlook.NoteItem
 
    'Change to the folder containing the source plain text files
    strLocalFolder = "E:\Notes"

    Set objFileSystem = CreateObject("scripting.FileSystemObject")
    Set objFolder = objFileSystem.GetFolder(strLocalFolder)
 
    'Import the text files as notes
    For Each objFile In objFolder.Files
        strFileExtension = objFileSystem.GetExtensionName(objFile)
        If strFileExtension = "txt" Then
           Set objTextStream = objFileSystem.OpenTextFile(objFile.Path)
           strText = objTextStream.ReadAll
 
           Set objNote = Outlook.Application.CreateItem(olNoteItem)
           objNote.Body = Left(objFileSystem.GetFileName(objFile), Len(objFileSystem.GetFileName(objFile)) - 4) & vbCrLf & vbCrLf & strText
           objNote.Save
        End If
    Next
End Sub

VBA Code - Batch Import Multiple Plain Text Files as Notes

  1. After that, tap on “F5” key button to run this macro.
  2. When macro finishes, go to the default “Notes” folder.
  3. There, you will see the new notes created from the Plain Text files, as shown in the following figure.Imported Notes

If Subject to Outlook Corruption

It is believed that multiple users have ever encountered some troubles in Outlook. Among those problems, the most cumbersome one is undoubtedly the seriously damaged Outlook data. Thereby, if you come across Outlook corruption, what will you do? You can firstly try the inbox repair tool. If it fails, you can proceed to take aid of a reliable and potent PST fix 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 corruption and outlook repair software products. For more information visit www.datanumen.com