Results 1 to 2 of 2

Thread: embed OLE object at run time

  1. #1
    Guest

    Post

    I am trying to show an image (.tif) file in an OLE object when a related record is selected from a database table. The database table has a field called DOC_NUM which is the same as the file name of the .tif image. I can show the first such image, the Sourcedoc of the OLE object, when I initiate the program, but I can't select the appropriate file at run time. I get an error: 31037; 'Contents of the OLESTREAM not in correct format'.

    This is the code I use to load the file:

    fNum = FreeFile
    With RecordsetName
    fImage = (driveath) & !DOC_NUM & ".tif"
    End With
    Open fImage For Binary As #fNum
    OLE1.Class = "WangImage.Document"
    OLE1.ReadFromFile (fNum)
    Close #fNum


    Any ideas?

  2. #2
    New Member
    Join Date
    Jun 2001
    Posts
    6
    I have done this many times and havent used anything more complicated than:

    OLE1.CreateLink App.Path & "\" & rs(1) & ".tif"

    Hope this works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width