SYMPTOMS
When you attempt to programmatically view the thumbnails of a Microsoft PowerPoint presentation, you may receive a run-time error message similar to the following:
DocumentWindow (unknown member) : Invalid enumeration value.
You receive this error message when either of the following lines of code are used in a Microsoft Visual Basic for Applications procedure:
ActiveWindow.ViewType = ppViewThumbnails
ActiveWindow.ViewType = ppViewMasterThumbnails
WORKAROUND
Microsoft provides programming examples for illustration only, without warranty either
expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes
that you are familiar with the programming language being demonstrated and the
tools used to create and debug procedures. Microsoft support professionals can
help explain the functionality of a particular procedure, but they will not
modify these examples to provide added functionality or construct procedures to
meet your specific needs. If you have limited programming experience, you may
want to contact a Microsoft Certified Partner or the Microsoft fee-based
consulting line at (800) 936-5200. For more information about Microsoft Certified
Partners, please visit the following Microsoft Web site:
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
NOTE: The following macro examples work only in PowerPoint. Visual Basic for Applications macros are not supported by the Microsoft PowerPoint Viewer. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
To work around this issue, you need to test to find out which pane is active, and then activate the Thumbnail pane. To do so, run the following macro:
Function CheckView() As Boolean
'
' This function assumes that you are already in Normal view.
' If you are unsure which view you are in, then first check
' to see if you are in ppViewNormal for the ActiveWindow
' ViewType. Switch if necessary, then run this code.
'
With ActiveWindow
'
' Test to see if you are already in Thumbnail view.
'
If .ActivePane.ViewType <> ppViewThumbnails Then
'
' If you are in a different view, then activate first pane of
' Normal view.
' Then set the ViewType to ppViewThumbnails.
' Set the function to return True, indicating success in switching
' views.
'
.Panes(1).Activate
.ViewType = ppViewThumbnails
CheckView = True
Else
'
' If the view is already in Thumbnail view, return False, indicating
' no change to the view was necessary.
'
CheckView = False
End If
End With
End Function