Placeholder pasting PPT 2007

T

tiamat

Hi,

Is there a way programmatically that I can paste a chart into a placeholder
on a power point slide?

I have the means to identify a placeholder on the slide but I have yet to
find any way to replicate the behaviour one observes when a user selects a
placeholder and pastes a chart from Excel into it using Ctrl V.

This effectively sizes the image from the clipboard to the dimensions of the
placeholder and it appears to hide the original placeholder. If one was to
delete the chart the original placeholder returns.

If anyone can provide any information it would be appreciated.
 
S

Shyam Pillai

Hi,
This is sample code to paste into an existing shape to mimic the PowerPoint
behavior

Sub PasteIntoShape()
'Copy the chart or chart may be in the clipboard.
ActivePresentation.Slides(2).Shapes(2).Copy
'Switch the slide containing the placeholder you wish to copy into
ActiveWindow.View.GotoSlide 3
' Select the placeholder shape
ActiveWindow.View.Slide.Shapes(2).Select
'Paste into the selection.
ActiveWindow.View.Paste
End Sub


Regards,
Shyam Pillai

Animation Carbon: http://www.animationcarbon.com
 
T

tiamat

That is great, does exactly what I needed, thank you very much.

Given that it does not hurt to ask. Is there a way that I can create/add the
contained object within a placeholder programmatically. What I am trying to
do, is to add a linked embedded Excel chart into a placeholder. If I can do
this without using the clipboard and views it would be very nice as it would
be a lot more presentable/tidier than my current but working approach with
help :)

Much appreciated.
 

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