Fitting linked excel chart objects to slide

K

Ken Johnson

Powerpoint 2003, window XP:
I'm trying to write a macro that will fit a shape to the slide. Each
slide has just the one shape object. I can't figure out how to refer
to the height and width of the slide, the slide object doesn't have
those properties.

My attempt so far looks like...

Sub Fit_Shape_To_Slide()
Dim Sld As Slide
For Each Sld In ActivePresentation.Slides
With Sld.Shapes(1)
.Top = 0
.Left = 0
.LockAspectRatio = True
.Height = ??????????
If .Width > ???????? Then
.Width = ????????
End If
End With
Next Sld
End Sub

How do I go about referring to the slide's height and width?

Or, is there an easier way?

Ken Johnson
 
K

Ken Johnson

Not to worry, I've figured it out.


Sub Fit_Charts_To_Slide()
Dim Sld As Slide
For Each Sld In ActivePresentation.Slides
With Sld.Shapes(1)
.Top = 0
.Left = 0
.LockAspectRatio = True
.Height = ActivePresentation.SlideMaster.Height
If .Width >
ActivePresentation.SlideMaster.Width Then
.Width =
ActivePresentation.SlideMaster.Width
End If
End With
Next Sld
End Sub


Ken Johnson
 

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