none
Convert OLE (Word doc) field to jpg or similar image field RRS feed

  • Question

  • I am upgrading an Access 2000 system from mdb to accdb.

    One table has an OLE field containing a Word document.

    I need to convert these 40,000+ records so the OLE field becomes a jpg / pdf or similar image that will then only be viewed on a form.

    I have been unable to find a reference to this type of task.

    Can you please help?

    Thursday, October 20, 2016 9:40 AM

All replies

  • First you're going to have to save the file locally, then convert it to PDF, then "reattach" it to your db.

    Take a look at:

    https://support.microsoft.com/en-us/kb/103257
    http://www.ammara.com/access_image_faq/read_write_blob.html

    That said, why?  Save the files locally, and simply store their paths and you can open/display them as required.


    Daniel Pineault, 2010-2016
    Microsoft MVP Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Thursday, October 20, 2016 12:39 PM
  • Thanks Daniel,

    I am rusty having been retired for many years now.

    Is there a way to automate saving them locally and storing the file path?

    Kind regards,

    F.D.

    Thursday, October 20, 2016 3:04 PM
  • You'd loop through the records and use the functions provided in the links I gave earlier.

    Daniel Pineault, 2010-2016
    Microsoft MVP Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Thursday, October 20, 2016 5:04 PM
  • Hi FreoDocker,

    you had mentioned that you want to save it locally and then store the path to db.

    below is a demo example code that you can use to understand and get the idea how you can try to fulfil your requirement.

    Sub getitout()
         Dim strTemp As String
         Dim rst As Recordset
         
         Set rst = CurrentDb.OpenRecordset("My Table", dbOpenDynaset) ' open the table
         With rst
             'Get to the record in question
             strTemp = !oleFieldName
         End With
         Open "C:\pic.bmp" For Binary As #1
         Put #1, 1, strTemp
         Close #1
     End Sub
    

    it is converting and saving the file. then you need to save that path in that same record.

    it is just a demo example. so you need to update it based on your requirement.

    Regards

    Deepak


    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.

    Friday, October 21, 2016 5:11 AM
    Moderator