简体   繁体   English

如何使用vba将ActiveWindow.ViewType更改为PowerPoint中的ppViewThumbnails

[英]how to change ActiveWindow.ViewType to ppViewThumbnails in PowerPoint using vba

ActiveWindow.ViewType = ppViewThumbnails

Above code run to following error message: 上面的代码运行到以下错误消息:

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

Help please 请帮助

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. 当您尝试以编程方式查看Microsoft PowerPoint演示文稿的缩略图时,您可能会收到一条运行时错误消息。 This behavior occurs because PowerPoint is not designed to let you view the thumbnails in the entire active window. 出现此问题的原因是PowerPoint不是为了让您在整个活动窗口中查看缩略图而设计的。 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. 解决方法在上面的kb文章中给出。 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 : 而不是假设您的视图是ppthumnails ,尝试使用以下IF首先验证它:

  With ActiveWindow
  If .ActivePane.ViewType <> ppViewThumbnails Then
        .Panes(1).Activate
        .ViewType = ppViewThumbnails
         CheckView = True
  Else
      CheckView = False
      End If
   End With

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM