Results 1 to 4 of 4
  1. #1
    springa is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    2

    Exporting Attachments to an external file

    Hi all,

    Firstly thanks for your help with this, I've been searching the net with no success... I have an access database with Attachments stored in a table.

    I have setup a report which shows all of the detail from my table including attachments. From this report I can open the attachments. I am trying to find a way to export the report to excel or to word or any program where it might be possible to export the files along with the record detail.



    Using the basic export functionality Access emails the file names but not the files themselves.

    Appreciate any help on this!

    Thanks,
    Gareth

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    can you post the code of how you are composing your email?

  3. #3
    springa is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    2
    Hi rpeare,

    At this stage I have the file set up using macros to attach my report as a pdf file attached to an email.

    I havent used any code as yet as I havent been able to find any solution at all regarding attachments.

    Appreciate any help you can give me.

    Thanks.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    So you're asking about how to set up an email in Access?

    this code will do what you want you just have to modify things to fit your particular database particularly if you're cycling through a lot of records:

    Code:
    Dim objOutl
    Set objOutl = CreateObject("Outlook.Application")
    Set objMailItem = objOutl.CreateItem(olMailItem)
    'comment the next line if you do not want to see the outlook window
    objMailItem.Display
    strEmailAddr  = "<email list as a string>"
    objMailItem.Recipients.Add strEmailAddr
    objMailItem.Body = "<body>"
    objMailItem.Attachments.Add "<path and file name>"
    objMailItem.Send
    Set objMailItem = nothing
    Set objOutl = nothing
    NOTE: I would strongly recommend you not store documents in Access, it will make your file blow up very quickly (size wise). What I'd do instead is just store the path where the file is stored, this not only saves room but would also make this code very easy to run.

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

Similar Threads

  1. Exporting Attachments per record
    By justinwright in forum Import/Export Data
    Replies: 5
    Last Post: 06-15-2011, 09:08 AM
  2. Browse to external file while in a form
    By michaeljohnh in forum Import/Export Data
    Replies: 9
    Last Post: 09-22-2010, 09:33 AM
  3. Exporting to Text File
    By blandow in forum Import/Export Data
    Replies: 2
    Last Post: 08-06-2010, 06:02 PM
  4. A way to force Access to update external file?
    By gkun in forum Import/Export Data
    Replies: 0
    Last Post: 10-27-2009, 06:11 PM
  5. Using data in external file for conditional processing
    By jkellygarrett in forum Import/Export Data
    Replies: 0
    Last Post: 09-17-2009, 01:01 PM

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