addpicture method

G

Guest

If you use record macro while adding a picture to a placeholder it shows code
for the addpicture method. And when you change slide layouts for this slide
the picture moves as the placeholder would. HOWEVER when you use this same
addpicture code in a simple VBA proc it adds the picture like a separate
shape and will not move it as it does with other placeholders when the layout
is changed. Is there some way I can programmatically add the pictrue and
have it behave as if it were entered into the placeholder shape?
 
D

David M. Marcovitz

The AddPicture method doesn't seem to have any parameters to specify that.
I think that the behvaior is determined by whether or not the placeholder
element is selected. If you are doing this in Normal/Edit View (not Slide
Show View), then you might be able to determine which shape to select,
select it, and then use AddPicture.
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
S

Shyam Pillai

The shape replacement and layout are not a part of th AddPicture method,
that's PowerPoint doing the additional work. You can do the same using VBA
but not automatically with the AddPicture method.


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com
 
G

Guest

I am selecting the correct shape when I use the addpicture function. There
are no other functions that I can find in VBA for Powerpoint that will add a
picture to that shape. Interestingly, if you make the picture a fill, it
will manage it as if it were entered manually and move the shape (with the
picture in it) when a new slide layout is chosen. I cannot find any
information on what "the additional work" is that Powerpoint is doing or I
would code that in VBA. Any better ideas? (I do extensive work with VBA in
Office products, I just can't find the trick to this one.)
 

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