Results 1 to 4 of 4
  1. #1
    DHIGHTO is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    30

    Importing Outlook attachments

    Hey guys,

    I'm trying to determine if it is possible to automatically import attachments from outlook emails into Access. Does anyone know if this is possible? I would think it would require VBA code.


    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I think you're right. I started with the Saving an Email Attachment code here:

    http://www.thatlldoit.com/Pages/howtosarticles.aspx
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    DHIGHTO is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    30
    So I found a a VBA code for exporting the attachments to a folder. Unfortunetly, my daily attachments are named the same so I have to set up a naming convention.

    Here is my code. I tried to add msgitem.receivedtime to the file name to add email received time, but thats not working. Any suggestions?

    ' Save any attachments found
    For Each Atmt In Item.Attachments
    ' This path must exist! Change folder name as necessary.
    ' FileName = "C:\Email Attachments\" & Atmt.FileName
    'if want to add a filter:
    'If Right(Atmt.FileName, 3) = "xls" Then

    FileName = WheretosaveFolder & "\" & Atmt.FileName & msgItem.ReceivedTime
    Atmt.SaveAsFile FileName
    i = i + 1
    Next Atmt
    Next Item


    Thanks

  4. #4
    DHIGHTO is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    30
    I'm getting a variable not defined with msgItem

Please reply to this thread with any new information or opinions.

Similar Threads

  1. getting outlook attachments using vba code
    By umenash in forum Access
    Replies: 3
    Last Post: 10-02-2013, 12:15 PM
  2. Replies: 2
    Last Post: 10-24-2012, 02:09 AM
  3. problem with importing email attachments to access
    By funi.t in forum Import/Export Data
    Replies: 1
    Last Post: 12-20-2011, 10:20 AM
  4. Exporting/Importing to Outlook
    By IdleJack in forum Import/Export Data
    Replies: 2
    Last Post: 08-27-2011, 06:13 AM
  5. Importing Data with Outlook
    By Stanggirlie in forum Import/Export Data
    Replies: 1
    Last Post: 07-15-2011, 08:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums