_Application.AutomationSecurity 属性

定义

返回或设置一个MsoAutomationSecurity常量,该常量表示 Microsoft Word以编程方式打开文件时使用的安全设置。

public:
 property Microsoft::Office::Core::MsoAutomationSecurity AutomationSecurity { Microsoft::Office::Core::MsoAutomationSecurity get(); void set(Microsoft::Office::Core::MsoAutomationSecurity value); };
public Microsoft.Office.Core.MsoAutomationSecurity AutomationSecurity { get; set; }
member this.AutomationSecurity : Microsoft.Office.Core.MsoAutomationSecurity with get, set
Public Property AutomationSecurity As MsoAutomationSecurity

属性值

注解

AutomationSecurity 属性的默认设置为 msoAutomationSecurityLow 。 因此,若要避免更改用户的安全设置或依赖于默认设置的中断性解决方案,在以编程方式打开文件后,应小心将此属性设置回其原始设置。

设置为 ScreenUpdatingFalse 不会影响警报,也不会影响安全警告。 设置 DisplayAlerts 将不适用于安全警告。 例如,如果用户将 DisplayAlerts 设置为 False ,将 AutomationSecurity设置为 msoAutomationSecurityByUI,而用户处于中等安全级别,则在宏运行时会出现安全警告。 这允许宏捕获文件打开错误,同时在文件打开成功时仍显示安全警告。

适用于