Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / April 2007

Tip: Looking for answers? Try searching our database.

Fitting linked excel chart objects to slide

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken Johnson - 29 Apr 2007 06:50 GMT
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
Ken Johnson - 29 Apr 2007 07:13 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.