VBA Code - Align slide within Content Box

  • Thread starter Thread starter ddate
  • Start date Start date
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.
 
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.
 
Back
Top