2013-02-17 44 views
0
ActiveWindow.ViewType = ppViewThumbnails 

上面的代碼運行到以下錯誤消息改變ActiveWindow.ViewType到ppViewThumbnails在PowerPoint:如何使用VBA

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

請幫助

+1

每個人的利益,請說明您正在使用的MS PowerPoint版本? 2003年,2007年,2010年..等.. – bonCodigo 2013-02-17 18:08:48

+1

對不起我的粗心,我使用Office 2007 – kagen88 2013-02-18 03:17:19

回答

2

你的問題,而很簡短...辯解作爲給出公正答案的問題。但是看着你的錯誤信息(謝天謝地,它的存在),這裏是你可以查閱一下:

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.

解決方法是上述知識庫文章中給出。請按照此方式告知我們是否仍然卡住:

要解決此問題,您需要測試以確定哪個窗格處於活動狀態,然後激活縮略圖窗格。

不要假設你的觀點是ppthumnails,請首先嚐試使用來驗證它下面IF

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

謝謝你回答我的問題,但我仍然在「.ViewType = ppViewThumbnails」行上得到相同的錯誤信息。但我有使用sendkeys.SendKeys找到了一個解決方案「%wi」 – kagen88 2013-02-18 12:28:33