Article ID: 161202
Article Last Modified on 10/11/2006
Sub SetSlideSize()
' Constant used to make calculating inches easier.
Const PTS As Byte = 72
' Create a presentation with the following dimensions:
' Width : 8 Inches
' Height: 6 Inches
With ActivePresentation.PageSetup
.SlideWidth = 8 * PTS
.SlideHeight = 6 * PTS
End With
End Sub
NOTE: The SlideWidth and SlideHeight property of PageSetup are measured
in points. To easily set the height or width in inches, multiply the number
of inches by 72.
Sub GetSlideSize()
' Declare the variables to store the slide height and width.
Dim Width As Single
Dim Height As Single
' Retrieve the width and height.
With ActivePresentation.PageSetup
Width = .SlideWidth
Height = .SlideHeight
End With
' Displays a message box with the slide's height and width.
MsgBox "Width is " & (Width / 72) & " inches and Height is " _
& (Height / 72) & " inches."
End Sub
NOTE: Since the SlideWidth and SlideHeight properties are in points, you
must divide by 72 to calculate the slide height and width in inches.
176476 OFF: Office Assistant Not Answering Visual Basic Questions
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: 97 8.00 kbmacro ppt8 vba vbe macppt mac_ppt ppt98 98 powerpt
Keywords: kbcode kbdtacode kbhowto kbmacro kbprogramming KB161202