Quantcast
Channel: Chris Bitting » vbscript
Viewing all articles
Browse latest Browse all 2

Remove or Hide PowerPoint Controls on All Slides

$
0
0

ppt3If you customize PowerPoint with controls (button, text boxes, labels, etc.) you may want to delete or hide these to create a clean version of your presentation. Below is a script you can use hide all of the controls (or you can filter). My example uses PowerPoint 2010 but should apply to most recent versions:

 

1. Create a new module: ppt1

2. Paste the below text:

Public Sub HideControls()

'keep a count of how many items hidden - just fyi
Dim cntrlCount As Integer
    'loop through slides
    For Each sld In ActivePresentation.Slides
        'loop through slide shapes - includes button, text boxes, ole controls, etc
        For Each shp In sld.Shapes
        
        ''Filter here if you want - by name or type
        ' If InStr(shp.Name, "command") >= 1 Then
        ' If shp.Type = 3 Then
        
        'set hidden
        shp.Visible = False
        
        'if you wanted to delete*: shp.Delete
        
        cntrlCount = cntrlCount + 1
        
        Next
    
    Next

MsgBox cntrlCount & " items affected."

End Sub

3. Click Run (green play button) to run this code and hide your controls. ppt2

 

If you want to show or unhide your controls, change shp.Visible = False to shp.Visible = True

 

*Note: if you use shp.Delete, you won’t be able to recover your items.



Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles



Latest Images