Skip to content

Latest commit

 

History

History
68 lines (40 loc) · 1.66 KB

PowerPoint.Application.WindowDeactivate.md

File metadata and controls

68 lines (40 loc) · 1.66 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Application.WindowDeactivate event (PowerPoint)
vbapp10.chm621010
vbapp10.chm621010
PowerPoint.Application.WindowDeactivate
89bf2c09-a1a8-ed7f-74d5-49f8f7c027a7
06/08/2017
medium

Application.WindowDeactivate event (PowerPoint)

Occurs when the application window or any document window is deactivated.

Syntax

expression.WindowDeactivate (Pres, Wn)

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
Pres Required Presentation The presentation displayed in the deactivated window.
Wn Required DocumentWindow The deactivated document window.

Example

This example finds the file name (without its extension) for the presentation in the window that is being deactivated. It then appends the .htm extension to the file name and saves it as a webpage in the same folder as the presentation.

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

See also

Application Object

[!includeSupport and feedback]