Close Method

Microsoft PowerPoint Visual Basic

Closes the specified document window, presentation, or open freeform drawing.

Caution  When you use this method, PowerPoint will close an open presentation without prompting the user to save their work. To prevent the loss of work, use the Save method or the SaveAs method before you use the Close method.

expression.Close

expression    Required. An expression that returns a DocumentWindow or Presentation object.

Example

This example closes all windows except the active window.

With Application.Windows
    For i = 2 To .Count
        .Item(i).Close
    Next
End With
		

This example closes Pres1.ppt without saving changes.

With Application.Presentations("pres1.ppt")
    .Saved = True
    .Close
End With
		

This example closes all open presentations.

With Application.Presentations
    For i = .Count To 1 Step -1
        .Item(i).Close
    Next
End With