Results 1 to 8 of 8
  1. #1
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659

    Open OLE Object

    I have an OLE Object field. How can I open stored objects using vba?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    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

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    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

  4. #4
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    I only right click and insert object into the field. using the built in interface. will check those functions.

  5. #5
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    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.

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe you can automate a form by adding a bound control and use Send Keys after setting focus.

  7. #7
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    Thats the route I have been after. I will keep at it till I get it, will provide solution when i figure it out.

  8. #8
    John A is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2022
    Posts
    1
    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

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

Similar Threads

  1. Replies: 13
    Last Post: 04-21-2016, 03:33 AM
  2. Replies: 2
    Last Post: 07-01-2014, 01:54 PM
  3. open a pdf stored as an ole object
    By khumbo in forum Access
    Replies: 5
    Last Post: 03-16-2013, 12:35 PM
  4. Export Data w/FSO - Open object recordset failed
    By JayZoll in forum Programming
    Replies: 1
    Last Post: 11-12-2012, 01:38 PM
  5. Replies: 4
    Last Post: 04-22-2011, 03:08 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