_Application.AutomationSecurity Property
Returns or sets a MsoAutomationSecurity constant that represents the security setting Microsoft Word uses when programmatically opening files.
Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.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: MsoAutomationSecurity
Remarks
The default setting of the AutomationSecurity property is msoAutomationSecurityLow. Therefore, to avoid changing the users' security settings or breaking solutions that rely on the default setting, you should be careful to set this property back to its original setting after programmatically opening a file.
Setting ScreenUpdating to False does not affect alerts and will not affect security warnings. The DisplayAlerts setting will not apply to security warnings. For example, if the user sets DisplayAlerts equal to False and AutomationSecurity to msoAutomationSecurityByUI, while the user is on Medium security level, then 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 open succeeds.