3
votes

I am programatically copying tables and graphs from Excel to PowerPoint.

Ideally, I'd like to center the graphs on the slide and resize them to fit the slide if necessary.

This shouldn't be too hard, and I can check & modify .Top, .Left, .Width, .Height of the shape just fine, but how do I find out the width/height of the slide itself to do the proper positioning?

1

1 Answers

2
votes

The following will give you the Height and Width ...

Just divide by 2 :D

Sub a()
   Dim a As Presentation
   Set a = ActivePresentation
   MsgBox a.PageSetup.SlideHeight, a.PageSetup.SlideWidth
End Sub

HTH