none
Is there a way to configure Outlook to automatically send certain emails to a folder on the computer as a text file RRS feed

  • Question

  • I need certain emails from certain email address to be automatically be places in folder on my computer as a text file. Is it possible to configure Outlook to do this?


    steven frierdich

    Monday, October 14, 2013 9:17 PM

Answers

  • Hi,

    According to your description, I think you want to save the certain emails which from the specified address into a location folder as a text file automatically.

    >>Is it possible to configure Outlook to do this? <<
    As far as I know, there are no such kind of  configuration to achieve your goal automatically.

    I suggest you to use a VBA. Here is VBA sample to save all the body content of the mails from the mail address “xxxx@xxxx.com” in the inbox to the location folder “C:\Users\Documents\MailFolder” as a text file.

    Sub GetBodyToText()
    
    Dim ns As NameSpace
    Dim Inbox As Outlook.MAPIFolder
    Dim folder As Outlook.MAPIFolder
    Dim file As TextStream
    Dim fs As FileSystemObject
    Dim folderPath As String
    
    Dim Item As Object
    Dim content As String
    
    Set ns = GetNamespace("MAPI")
    
    Set Inbox = ns.GetDefaultFolder(olFolderInbox)
    
    If Inbox.Items.Count = 0 Then
       MsgBox "There are no messages in the Inbox.", vbInformation, _
            "Nothing Found"
       Exit Sub
    End If
    i = 0
    
    folderPath = "C:\Users\Documents\MailFolder\"
    Set fs = New FileSystemObject
    
    For Each Item In Inbox.Items
        If Item.SenderEmailAddress = "xxxx@xxxx.com" Then
            i = i + 1
            Set file = fs.CreateTextFile(folderPath & Item.SenderName & "_" & i & ".txt", True)
            content = Item.Body
            file.WriteBlankLines intBlankLine
            file.writeline (content)
            file.Close
        End If
    Next Item
    End Sub
    


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 15, 2013 11:09 AM
    Moderator

All replies

  • I don't think there is a default option available, but this can be done using Outlook rule + VBA macro.

    Regards, Vinod Shalgar Please remember to mark the replies as answers if they help you.

    Tuesday, October 15, 2013 6:37 AM
  • Hi,

    According to your description, I think you want to save the certain emails which from the specified address into a location folder as a text file automatically.

    >>Is it possible to configure Outlook to do this? <<
    As far as I know, there are no such kind of  configuration to achieve your goal automatically.

    I suggest you to use a VBA. Here is VBA sample to save all the body content of the mails from the mail address “xxxx@xxxx.com” in the inbox to the location folder “C:\Users\Documents\MailFolder” as a text file.

    Sub GetBodyToText()
    
    Dim ns As NameSpace
    Dim Inbox As Outlook.MAPIFolder
    Dim folder As Outlook.MAPIFolder
    Dim file As TextStream
    Dim fs As FileSystemObject
    Dim folderPath As String
    
    Dim Item As Object
    Dim content As String
    
    Set ns = GetNamespace("MAPI")
    
    Set Inbox = ns.GetDefaultFolder(olFolderInbox)
    
    If Inbox.Items.Count = 0 Then
       MsgBox "There are no messages in the Inbox.", vbInformation, _
            "Nothing Found"
       Exit Sub
    End If
    i = 0
    
    folderPath = "C:\Users\Documents\MailFolder\"
    Set fs = New FileSystemObject
    
    For Each Item In Inbox.Items
        If Item.SenderEmailAddress = "xxxx@xxxx.com" Then
            i = i + 1
            Set file = fs.CreateTextFile(folderPath & Item.SenderName & "_" & i & ".txt", True)
            content = Item.Body
            file.WriteBlankLines intBlankLine
            file.writeline (content)
            file.Close
        End If
    Next Item
    End Sub
    


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 15, 2013 11:09 AM
    Moderator
  • Thanks for the input. I just wrote a plug in to do it.

    steven frierdich

    Thursday, October 17, 2013 8:31 PM
  • Hi stevensrf, 

    Since we haven't heard from you for a long time, I temporarily close this case. I mark useful reply as answer. If you have any concerns, please free feel to reopen it or submit a new question.

    Thanks for your understanding. 
    Best regards, 
    Luna


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 21, 2013 1:01 PM
    Moderator