Close 方法

       

关闭指定的文档窗口、演示文稿或打开的任意多边形。

警告  使用此方法,PowerPoint 关闭打开的演示文档,并且不提示用户保存所做的工作。为防止工作丢失,您应在使用 Close 方法之前使用 SaveSaveAs 方法。

expression.Close

expression  必选。该表达式返回一个 DocumentWindowPresentation 对象。

示例

本示例关闭除活动窗口外的所有窗口。

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

本示例不保存更改,关闭 Pres1.ppt 文件。

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

本示例关闭所有打开的演示文稿。

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