I have an OLE Object field. How can I open stored objects using vba?
I have an OLE Object field. How can I open stored objects using vba?
I believe it has to do with how you stuffed the file in there. What is the file type and did you use a control on a form to do the job.
This thread has a couple posts about some hurdles ...
https://www.accessforums.net/showthread.php?t=4976
If you cannot get that function to work (here is a link to it that is easier to copy and I think I have a sample of it working)
https://support.microsoft.com/en-us/kb/210486
then you might try a utility created by Lebans. I think his utility uses a similar approach. However he seems to claim his utility is good for more than one OLE wrapper. Also, you will need to add his dll file to your system 32. I have found that W7 and W8 will default to the Windows folder. So you might want to copy the dll there.
http://www.lebans.com/oletodisk.htm
I only right click and insert object into the field. using the built in interface. will check those functions.
When i double click the data the data that is in the field from the table, it opens whatever default viewer is related to the document. this is the level of automation i hope to achieve with vba.
Maybe you can automate a form by adding a bound control and use Send Keys after setting focus.
Thats the route I have been after. I will keep at it till I get it, will provide solution when i figure it out.
Link to the Object in your table by using an Object Frame on a form (e.g., 'objfrmDocument'). (If the form uses the table as its record source, you can use a Bound frame; if not use an Unbound frame and set the Control source to the object using a DLookup). Make the frame not visible. Add a Label to form (e.g. "Open document"; lblOpenDoc). In the On click event, set up an Event Procedure:
Private Sub lblOpenDoc_Click()
With Me.objfrmDocument
.Verb = acOLEVerbOpen
.Action = acOLEActivate
End With
End sub