Answered by:
Documents stored in the OLE Object Field

Question
-
I really like the automation available for storing images/PDF's within an OLE Object field. I can double click the data/icon within the field and it opens the information in the default viewer for the document. How can I replicate this automation with vba. I was trying a Dlookup but that doesnt seem to work out so well. I dont want to join the data via query.
Here is what I am trying, the "Image" field is the OLE Object field.
Dim oDrawing As Image
Debug.Print Customer_Number
Debug.Print Production_Level
oDrawing = DLookup("[Image]", "qryPartDrawingAssets", "[CustomerNumber]='" & Customer_Number & "' AND [ProductionStage]=" & Production_Level)
Thank you for your time
Friday, September 9, 2016 3:24 PM
Answers
-
Hi,
If my assumption above is correct, take a look at this page for a possible method to extract the file out of the table.
Hope it helps...
- Marked as answer by Imperceptus Friday, September 9, 2016 4:48 PM
Friday, September 9, 2016 3:43 PM
All replies
-
Hi,
If I understand you correctly, I think maybe, you may have to extract the object to a temporary location and then use ShellExecute API to open it.
Just a thought...
Friday, September 9, 2016 3:31 PM -
Hi,
If my assumption above is correct, take a look at this page for a possible method to extract the file out of the table.
Hope it helps...
- Marked as answer by Imperceptus Friday, September 9, 2016 4:48 PM
Friday, September 9, 2016 3:43 PM -
This sounds like a logical solution. I will try it out thank you.Friday, September 9, 2016 4:47 PM
-
Hi,
You're welcome! Good luck. Let us know how it goes...
Friday, September 9, 2016 4:52 PM