slide_width = ActivePresentation.PageSetup.SlideWidth slide_height = ActivePresentation.PageSetup.SlideHeight For i = 1To ActivePresentation.Slides.Count ActiveWindow.View.GotoSlide Index:=i Set rect = ActivePresentation.Slides(i).Shapes.AddShape(Type:=msoShapeRectangle, _ Left:=0, Top:=0, Width:=slide_width, Height:=slide_height) ForEach s In ActivePresentation.Slides(i).Shapes If ShapesSeparate(s, rect) Then s.Select Replace:=msoFalse EndIf Next OnErrorResumeNext ActiveWindow.Selection.ShapeRange.Delete OnErrorGoTo0 rect.Delete Next ActiveWindow.View.GotoSlide Index:=1 MsgBox "欄外のオブジェクトを削除しました."