insert PNG image into OLE field in VB

G

Guest

(using winXP and MSA XP/Dev)

1st, I want to display a bunch of little bitmaps, (PNGs) in continuous
forms. So the usual trick of storing filepaths and using an unbound image
control at runtime won't work and I HAVE to store them as OLE data, right?

I've read conficting things on the web about this.

One guy sez I have to put the data through an OLE control (on a form) and
gave me code to do that:

Me.LibItemIconOLE.Class = "Bitmap Image"
Me.LibItemIconOLE.OLETypeAllowed = acOLEEmbedded
Me.LibItemIconOLE.SourceDoc = Me.LibItemPNGFilePath
Me.LibItemIconOLE.UpdateOptions = Automatic
Me.LibItemIconOLE.SizeMode = acOLESizeStretch

but that code only seems to effect the CONTROL and not the bound datafield.
(and doesn't put any data in the field at all)

another post sez I should use the "AppendChunk" method but niether the OLE
field or it's bound control seems to allow that.

The closest I've gotten is being able to put "Long Binary Data" into the
..Value of the field, (a BLOB?) but of course that won't display.

to repeat: I'm not convinced I have to store pics in OLE at all if there is
any other to display images in CONTINUOUS FORMs. but I don't think that there
is.

so can someone point me to the right OLE image primer? or tell what I'm
doing wrong

aha tia
roger
 
J

John Nurick

Hi Roger,

In these circumstances it makes sense, IMO, to store the PNGs as
embedded objects in an OLE field. The official way to load a series of
objects is to automate a form with an BoundObjectFrame control as per
http://support.microsoft.com/kb/158941; otherwise you have to find or
write code that packages the PNG file as an embedded object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top