OfficeTips Home || VBA Section || General Section || Download Section || Privacy Policy

How to activate the tab of choice (Outline/Slides) in PowerPoint 2002 and later<

 

You cannot achieve it thru the object model since the ViewType property is read-only when it applies to Panes object. But you can get around it making use of command bar control ID 6015 which toggles between thumbnails and outline view of the pane.
It  appears in the Tools | Customize | Commands | Categories: View, Commands: Show Outline.
 

 

Sub SetSlideTab()
Dim oCmdButton As CommandBarButton
Set oCmdButton = CommandBars("Standard").Controls.Add(Id:=6015)
DoEvents
ActiveWindow.ViewType = ppViewNormal

If Not oCmdButton Is Nothing Then
    If ActiveWindow.Panes(1).ViewType = ppViewOutline Then
        oCmdButton.Execute
    End If
    oCmdButton.Delete
    Set oCmdButton = Nothing
End If
End Sub

Sub SetOutlineTab()
Dim oCmdButton As CommandBarButton
Set oCmdButton = CommandBars("Standard").Controls.Add(Id:=6015)
DoEvents
ActiveWindow.ViewType = ppViewNormal

If Not oCmdButton Is Nothing Then
    If ActiveWindow.Panes(1).ViewType = ppViewThumbnails Then
        oCmdButton.Execute
    End If
    oCmdButton.Delete
    Set oCmdButton = Nothing
End If
End Sub

 
 

Copyright 1999-2018 (c) Shyam Pillai. All rights reserved.