PowerPoint VBA: Fitting Slides to Window

This PowerPoint VBA macro fits slides to the window.

Macro Example

Sub FitsSlidesToWindow()

  ActiveWindow.View.ZoomToFit = msoTrue

End Sub

Description

[Application.]ActiveWindow

  ActiveWindow...

The Application.ActiveWindow property returns the DocumentWindow object that represents an active document window.

obj-PowerPoint-Application-ActiveWindow

Because the ActiveWindow property is a member of the PowerPoint.Global class, we can omit the Application property.

obj-PowerPoint-Global-ActiveWindow

ActiveWindow.View (DocumentWindow.View)

  ActiveWindow.View...

The ActiveWindows.View (DocumentWindow.View property) returns the View object that represents a view in the document window.

obj-PowerPoint-DocumentWindow-View

View.ZoomToFit

  ActiveWindow.View.ZoomToFit...

The View.ZoomToFit property determines whether the view is zoomed to fit the dimensions of the window every time the window is resized.

obj-PowerPoint-View-ZoomToFit

Fitting Slides to Window

  ActiveWindow.View.ZoomToFit = msoTrue

By setting the View.ZoomToFit property to msoTrue, the view is zoomed to fit the window.

Sub FitsSlidesToWindow()

  ActiveWindow.View.ZoomToFit = msoTrue

End Sub

Properties

http://www.relief.jp/itnote/archives/powerpoint-vba-fit-slide-to-window.php

Apply to

  • PowerPoint 2013
  • PowerPoint 2010
  • PowerPoint 2007