A demo program is included to get you started. I suggest stepping through the code, as I was consistently getting errors with the 5 or so lines under:
[green]' Add a few other items that pertain to OLE files only...[/green]
I ended up just commenting it out. Anyway, when you run it, open an rpt file that has a preview picture saved, then when the file information is loaded, check the 'Preview Document' checkbox to see your preview image.
Just in case this will be useful for anyone else here's my final code. I've got a picture box on the form called RepPreview and you'll need to reference the dsofile.dll file which can be found at the link vidru provided above.
'This goes in the general declarations
Private RPTProps As DSOFile.OleDocumentProperties
Function OpenDocumentProperties(sFile As String)
Dim RPTSummProps As DSOFile.SummaryProperties, RPTPicDisp As StdPicture
Set RPTProps = New DSOFile.OleDocumentProperties
RPTProps.Open sFile
Set RPTSummProps = RPTProps.SummaryProperties
If Not IsEmpty(RPTSummProps.Thumbnail) Then
Set RPTPicDisp = RPTSummProps.Thumbnail
If Not RPTPicDisp Is Nothing Then
Set RepPreview.Picture = RPTPicDisp
RepPreview.Visible = True
End If
Else
RepPreview.Visible = False
Set RepPreview.Picture = Nothing
End If
RPTProps.Close
Set RPTProps = Nothing
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.