Supercharge your PowerPoint productivity with
Supercharge your PPT Productivity with PPTools - Click here to learn more.

Proud member of

PPTools

Image Export converts PowerPoint slides to high-quality images.

PPT2HTML exports HTML even from PowerPoint 2010 and 2013, gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements

Merge Excel data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more

Resize your presentations quickly and without distortion

Language Selector switches the text in your presentation from one language to another

FixLinks prevents broken links when you distribute PowerPoint presentations

Shape Styles brings styles to PowerPoint. Apply complex formatting with a single click.

Add an outline showing the edges of slides

Problem

Sometimes we need to work with shapes or images that are larger than the slides that they sit on, or that otherwise hide the edges of one or more slides. This can make it impossible to tell exactly what will appear on the slide during a slide show, or print.

Solution

To work around the problem, we can have VBA add an outline to each slide ... a colored, unfilled rectangle that sits just outside the edge of the slide. Anything within the rectangle will be visible during a slide show and/or will print.

Copy and paste the code below into the presentation you're working on or (better!) into a separate presentation.
Make the presentation you're working on the active presentation, press Alt+F8 and choose OutlineSlides as the macro to run (you'll need to select All Open Presentations first if you've put the code in a separate presentation).

Do the same thing but choose DeOutlineSlides to remove the outlines later if desired.

Option Explicit

Sub OutlineSlides()

Dim oSl As Slide
Dim oSh As Shape
Dim x As Long

For Each oSl In ActivePresentation.Slides

    ' Check for existing outline shape
    ' Delete it if present
    For x = oSl.Shapes.Count To 1 Step -1
        If Len(oSl.Shapes(x).Tags("OUTLINE")) > 0 Then
            oSl.Shapes(x).Delete
        End If
    Next

    ' Now add an outline
    Set oSh = oSl.Shapes.AddShape(msoShapeRectangle, _
        -2, _
        -2, _
        ActivePresentation.PageSetup.SlideWidth + 4, _
        ActivePresentation.PageSetup.SlideHeight + 4)
    With oSh
        .Tags.Add "OUTLINE", "Y"
        .Fill.Visible = False
        With .Line
            .Visible = True
            .Weight = 2
            .ForeColor.RGB = RGB(255, 0, 0)
        End With
    End With

Next	' Slide

End Sub

Sub DeOutlineSlides()
' Run this to remove all slide outlines

Dim oSl As Slide
Dim oSh As Shape
Dim x As Long

For Each oSl In ActivePresentation.Slides

    ' Check for existing outline shape
    ' Delete it if present
    For x = oSl.Shapes.Count To 1 Step -1
        If Len(oSl.Shapes(x).Tags("OUTLINE")) > 0 Then
            oSl.Shapes(x).Delete
        End If
    Next	' Shape

Next	' Slide

End Sub

See How do I use VBA code in PowerPoint? to learn how to use this example code.


Did this solve your problem? If so, please consider supporting the PPT FAQ with a small PayPal donation.
Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2022 Stephen Rindsberg, Rindsberg Photography, Inc. and members of the MS PowerPoint MVP team. You may link to this page but any form of unauthorized reproduction of this page's contents is expressly forbidden.

Supercharge your PPT Productivity with PPTools

content authoring & site maintenance by
Friday, the automatic faq maker (logo)
Friday - The Automatic FAQ Maker

Add an outline showing the edges of slides
http://www.pptfaq.com/FAQ01281-Add-an-outline-showing-the-edges-of-slides.htm
Last update 23 October, 2019
Created: 23 October, 2019