Results 1 to 7 of 7
  1. #1
    CapsFan is offline Novice
    Windows 8 Access 2013 64bit
    Join Date
    May 2017
    Posts
    4

    Export attached Access jpegs to Word (not from C: folder...I got that)

    I have working VBA that creates Word documents from Access data and can insert jpeg's into the headers, but the jpegs are in a folder on the C: drive.



    Now the customer wants the jpegs in the database (which I can do) so he can move the database from machine to machine without remapping the C: folder path for the jpegs.

    What is the VBA to insert the same jpegs into Word docs that are now attachments in the Access database?

    Thanks,

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    you really DONT want jpgs in the database. They will fill up the db past the 2 Gig limit fast.
    Keep the jpg paths in the db instead. They can be opened or loaded anywhere and keep the size low.

  3. #3
    CapsFan is offline Novice
    Windows 8 Access 2013 64bit
    Join Date
    May 2017
    Posts
    4
    Thanks for the reply ranman256. I've explained that to the customer. Their concern is how to easily remap the folder containing the pics.

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    What do you mean by "remapping"? All C drives have the same folders for users. There will be a folder for the user name, C:\Users\username.... which can be used as the path for all machines.

  5. #5
    CapsFan is offline Novice
    Windows 8 Access 2013 64bit
    Join Date
    May 2017
    Posts
    4
    The customer does not want the database files on the first level C drive. The users may not have the same folder schema as mine (e.g; C:\[user]\[Project]\pictures) , so they would have to create that first.

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    According to Microsoft, "Graphical elements — logos, data in OLE object fields, and attachments that are part of the source data — are not exported." Refer https://support.office.com/en-us/art...3-8ca8908a1354

    It seems that for Word the jpg's need to resided in a folder. In your procedure you would check to see if the folder exists (see here for the code http://allenbrowne.com/func-11.html )
    and if it doesn't then create it (MkDir) and copy the file(s) to that folder. You can delete the folder when you done if desired.

  7. #7
    CapsFan is offline Novice
    Windows 8 Access 2013 64bit
    Join Date
    May 2017
    Posts
    4
    aytee111, thanks for the info. That's the direction I'm going to steer the customer towards. You all have been a big help.

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

Similar Threads

  1. Export Data from Access to Word
    By Byrkster in forum Access
    Replies: 4
    Last Post: 07-22-2016, 08:00 AM
  2. Replies: 7
    Last Post: 04-18-2016, 09:33 AM
  3. Replies: 0
    Last Post: 01-11-2016, 02:13 AM
  4. Saving Word in new folder
    By NejcZ in forum Programming
    Replies: 8
    Last Post: 09-10-2014, 11:03 PM
  5. export access report to word
    By afshin in forum Access
    Replies: 6
    Last Post: 01-15-2014, 12:11 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