Skip to content

Latest commit

 

History

History
82 lines (41 loc) · 2.71 KB

PowerPoint.Application.AutomationSecurity.md

File metadata and controls

82 lines (41 loc) · 2.71 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Application.AutomationSecurity property (PowerPoint)
vbapp10.chm502048
vbapp10.chm502048
PowerPoint.Application.AutomationSecurity
942341fe-5290-2903-db70-4e7cff0d75c7
06/08/2017
medium

Application.AutomationSecurity property (PowerPoint)

Represents the security mode that Microsoft PowerPoint uses when it opens files programmatically. Read/write.

Syntax

expression. AutomationSecurity

expression A variable that represents an Application object.

Return value

MsoAutomationSecurity

Remarks

This property is automatically set to msoAutomationSecurityLow when the application is started. Therefore, to avoid breaking solutions that rely on the default setting, you should be careful to reset this property to msoAutomationSecurityLow after programmatically opening a file. Also, to avoid malicious subversion, you should set this property immediately before and after you open a file programmatically .

The value of the DisplayAlerts property does not apply to security warnings. For example, if the user sets the DisplayAlerts property equal to False and the AutomationSecurity property to msoAutomationSecurityByUI, while the user is on Medium security level, there will be security warnings while the macro is running. This allows the macro to trap file open errors, while still showing the security warning if the file succeeds in opening.

The value of the AutomationSecurity property can be one of these MsoAutomationSecurity constants.

Constant Description
msoAutomationSecurityByUI Uses the security setting specified in the Trust Center dialog box.
msoAutomationSecurityForceDisable Disables all macros in all files opened programmatically without showing any security alerts.
msoAutomationSecurityLow Enables all macros. This is the default value when the application is started.

Example

This example captures the current automation security setting, changes the setting to disable macros, displays the Open dialog box, and after opening the selected presentation, sets the automation security back to its original setting.

Sub Security()

    Dim secAutomation As MsoAutomationSecurity



    secAutomation = Application.AutomationSecurity



    Application.AutomationSecurity = msoAutomationSecurityForceDisable

    Application.FileDialog(msoFileDialogOpen).Show



    Application.AutomationSecurity = secAutomation



End Sub

See also

Application Object

[!includeSupport and feedback]