_Application.AutomationSecurity Property
Represents the security mode that Microsoft PowerPoint uses when it opens files programmatically. Read/write.
Namespace: Microsoft.Office.Interop.PowerPoint
Assembly: Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)
Syntax
'Declaration
Property AutomationSecurity As MsoAutomationSecurity
Get
Set
'Usage
Dim instance As _Application
Dim value As MsoAutomationSecurity
value = instance.AutomationSecurity
instance.AutomationSecurity = value
MsoAutomationSecurity AutomationSecurity { get; set; }
Property Value
Type: Microsoft.Office.Core.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 AutomationSecurityproperty 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 |
---|---|
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. |
Enables all macros. This is the default value when the application is started. |