VBA Code - Align slide within Content Box

D

ddate

I currently use a macro from Excel to paste a table into Powerpoint. My only
issue is when it paste in powerpoint it has to be resized. Is there a way I
can revise the code so that when it paste it will automatically copy into the
content box. Not sure if I'm referring to it correctly but it's the dotted
lines box on title/content slide.

' Align the pasted range
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True

Thanks.
 
J

John Wilson

See if this works:

xx = slide number with content placeholder

Dim oshp As Shape
'make view active
ActiveWindow.View.GotoSlide xx
'select a suitable placeholder
Set oshp = ActivePresentation.Slides(xx).Shapes(2)
'maybe do some checks here
'is it a placeholder eg
oshp.Select
'paste into
ActiveWindow.View.Paste

If you have 2007 you will also need to check the type of the placeholder.
 

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