Article ID: 162352
Article Last Modified on 10/11/2006
Name of Constant Description
---------------- -----------
ppWindowMaximized Specifies that the window is maximized.
ppWindowMinimized Specifies that the window is minimized.
ppWindowNormal Specifies the window is neither maximized nor
minimized.
Sub GetWindowState()
' WindowState property is a long.
Dim lPowerPointWindowState As Long
Dim lActiveWindowState As Long
' Retrieve the application window state.
lPowerPointWindowState = PowerPoint.Application.WindowState
' Retrieve the active window's window state.
lActiveWindowState = ActiveWindow.WindowState
End Sub
The WindowState property is a Long data type. So, the two variables
(lPowerPointWindowState and lActiveWindowState) are declared as longs.
Sub SetWindowState()
' Minimizes the active presentation.
ActiveWindow.WindowState = ppWindowMinimized
' Maximizes PowerPoint.
PowerPoint.Application.WindowState = ppWindowMaximized
End Sub
NOTE: You can only set the WindowState of a presentation that is currently
the ActiveWindow.
If ActiveWindow.WindowState <> ppWindowMinimized Then
ActiveWindow.WindowState = ppWindowMinimized
End If
This code example changes the WindowState only if the ActiveWindow is
not already minimized. If the ActiveWindow is minimized, the code continues
after the End If statement.
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: 97 8.00 kbmacro kbpptvba ppt8 vba vbe
Keywords: kbcode kbdtacode kbhowto kbmacro kbprogramming KB162352