当对应用程序窗口或任意文档窗口取消活动状态时发生此事件。
Private Sub application_WindowDeactivate(ByVal Pres As Presentation, ByVal Wn As DocumentWindow)
application Application 类型的对象,在类模块中声明,自身具有事件。有关使用 Application 对象的事件的详细信息,请参阅使用 Application 对象的事件。
Pres 在非活动窗口中显示的演示文稿。
Wn 非活动文档窗口。
本示例查找非活动窗口中演示文稿的文件名(不含扩展名)。然后向该文件名添加 .htm 扩展名,并将其作为 Web 页保存在演示文稿所在的同一文件夹中。
Private Sub App_WindowDeactivate _ (ByVal Pres As Presentation, ByVal Wn As DocumentWindow)
FindNum = InStr(1, Wn.Presentation.FullName, ".")
If FindNum = 0 Then
HTMLName = Wn.Presentation.FullName & ".htm"
Else
HTMLName = Mid(Wn.Presentation.FullName, 1, FindNum - 1) _
& ".htm"
End If
Wn.Presentation.SaveCopyAs HTMLName, ppSaveAsHTML
MsgBox "Presentation being saved in HTML format as " _
& HTMLName & " ."
End Sub