开发者

how to disable macro in word document before opening it

开发者 https://www.devze.com 2023-03-09 04:13 出处:网络
i am programmatically opening the word document to do some process automatically without manual intervention. in some word document there are macro (such as showing message box while opening). while o

i am programmatically opening the word document to do some process automatically without manual intervention. in some word document there are macro (such as showing message box while opening). while opening the document it show the message box and user need manual intervention to continue the process. so i need to disable the macro before ope开发者_Python百科ning the word document programatically

help me to overcome the problem


I haven't tried it for myself, but I think the application.AutomationSecurity = Microsoft.Office.Core.MsoAutomationSecurity.msoAutomationSecurityForceDisable should disable all macros from being executed. Also, you might achieve what you want with setting the DisplayAlerts property: application.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone

0

精彩评论

暂无评论...
验证码 换一张
取 消