Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there an easy way to data read excel files that are attached in emails in Outlook? Im sure this is scriptable, but I dont particularly want to write it.

Is there a program out there that can accomplish this?

share|improve this question

1 Answer 1

A broad answer given your question wasn't very detailed

  • ie what do you mean by read,
  • all messages in a folder etc)

You can strip all the Excel files from all messages in an Outlook folder with the following VBA

This code looks at messages in a Outlook folder called "temp" below the Inbox Any Excel files as attachments are saved to C:\test

Other sample code at http://stackoverflow.com/questions/7890612/excel-vba-code-to-save-an-attachment-excel-file-from-an-outlook-email-that-was

Sub SaveOlolAttachments()

    Dim olFolder As Outlook.MAPIFolder
    Dim olMsg As Outlook.MailItem
    Dim olAtt As Outlook.olAttachment
    Dim fsSaveFolder As String
    strSaveFolder = "C:\test\"

    'My testing done in Outlok using a "temp" folder underneath Inbox
    Set olFolder = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
    Set olFolder = olFolder.Folders("Temp")
    If olFolder Is Nothing Then Exit Sub

    For Each olMsg In olFolder.Items
        For Each olAtt In olMsg.olAttachments
            If Right$(olAtt.FileName, Len(olAtt.FileName) - InStrRev(olAtt.FileName, ".")) Like "xl?*" Then olAtt.SaveAsFile fsSaveFolder & olAtt.FileName
        Next
    Next
End Sub
share|improve this answer
    
cool thanks, i will test it out. will have to tweak it a little to grab the right files and save them uniquely. –  Keltari Dec 8 '11 at 16:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.