Pictures and Layout

S

Stephan

Hello,

I use PowerPoint 2003 and I want to automatically add several pictures to a
slide with a layout with an addin.

If I do it manually I create a new slide with the e.g. 3 picture
placeholders I add a picture to every placeholder. If I now change the layout
the pictures will change/move too.

If I do this with my addin, I can identify the placeholders, add a picture
the same size but if I later change the layout the picture don't move.

Here comes my code:

For Each tmpShape In tmpActiveSlide.Shapes.Placeholders
If tmpShape.PlaceholderFormat.Type =
PowerPoint.PpPlaceholderType.ppPlaceholderBitmap Or _
tmpShape.PlaceholderFormat.Type =
PowerPoint.PpPlaceholderType.ppPlaceholderObject Then
tmpX = tmpShape.Left
tmpY = tmpShape.Top


tmpActiveSlide.Shapes.AddPicture(dlgOpenFileDialog.FileName,
MsoTriState.msoFalse, MsoTriState.msoCTrue, tmpX, tmpY, tmpShape.Width,
tmpShape.Height)
End If
Next

--Stephan
 
J

John Wilson

Staphan

Your code is adding the pic to the slide at the placeholder position but not
INTO the placeholder.

After adding it try .cut to put on clipboard
Then
ActiveWindow.View.GotoSlide (the slide)
TmpShape.Select
ActiveWindow.View.Paste

Does that work?
--
john ATSIGN PPTAlchemy.co.uk
Custom vba coding and PPT Makeovers
Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html
PPTLive Atlanta 2009
 

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