Question

ActiveWindow.ViewType = ppViewThumbnails

Above code run to following error message:

"DocumentWindow (unknown member) : Invalid enumeration value."

Help please

Was it helpful?

Solution

Your question is rather very brief...to justify as a question to give a fair answer. However looking at your error message (thank Goodness it's there) here is what you can check:

When you try to programmatically view the thumbnails of a Microsoft PowerPoint presentation, you may receive a run-time error message that you have gotten. This behavior occurs because PowerPoint is not designed to let you view the thumbnails in the entire active window. Thumbnails can be viewed only in the Thumbnail pane to the left of the slide pane. The lines of code described in the "Symptoms" section attempt to display the thumbnails in the entire active window.

Workaround is given in the above kb article. Please follow that and let us know if you get stuck still:

To work around this issue, you need to test to find out which pane is active, and then activate the Thumbnail pane.

Instead of assuming your view is ppthumnails, try to validate it first using the following IF:

  With ActiveWindow
  If .ActivePane.ViewType <> ppViewThumbnails Then
        .Panes(1).Activate
        .ViewType = ppViewThumbnails
         CheckView = True
  Else
      CheckView = False
      End If
   End With
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top