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.