Programmatically inserting a bitmat into a slide

P

Primoz Bradac

Having posted a question to microsoft.public.office.developer.vba and
getting no answer I'm reposting it here, hopefully with more luck :)

Here is the problem:

I'm using Office 2003 and automating PPT from Access. Actually I'm
creating a presentation: each slide should represent the contents of a
record from an Access table.

I use ADODB to retrieve the recordset and then put the text fields on a
slide with Layout = ppLayoutTextAndObject.

There is no difficulty putting the text fields of each record onto a
slide with e.g.:

oSlide.Shapes(2).TextFrame.TextRange.Text = rst.Fields("Name")

(Note: oSlide.Shapes(1) is the Title shape of the slide!)
It works fine.

The problem is I'cant figure out how to put a bitmap from a field in the
recordset which is OLEObject on the third shape of each slide. Actually
I'm looking for the property following:

oSlide.Shapes(3).<what comes here?> = rst.Fields("BitmapPicture")

Can anybody give some advice?

TIA,
Primoz
 
P

Primoz Bradac

Thanks Steve for your answer!

I've figured out myself that it's easier to work with bitmap pictures
separated from Access DB and having only paths kept in a field of a
table. I use

oSlide.Shapes.AddPicture FileName:=sPath, _
LinkToFile:=False, SaveWithDocument:=True,Left:=...

and it works fine.
But suppose I'd like to have bitmap pictures embedded in a table as
OLEfield.

I don't quite understand what you mean with
Dim oSh as Shape
Set oSh = oSlide.Shapes.Paste(1)

I'm certanly not going to copy pictures from a table field to a
clipboard manually and then put it on a slide with these statements.
Or I misunderstood you ?

What I want is to loop through all ADODB recordset-records and in each
turn insert bitmap picture from the record into a PPT shape on a slide.

Primoz
 

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