Handle word pop ups while running an automated code using Interop
We have .NET automation code for processing a word document - this is being invoked from Automation Anywhere. Using the Interop's 'word.DisplayOptions' method, most of the anticipated pop ups have been handled, however, there are few intermittent pop ups at word application level which is causing our automated run to fail. Please give me some suggestions to handle such issues.
Requirement: Make formatting changes in word document and add relevant comments based on flags set in excel sheet. This .NET code is invoked by a bot after certain conditions are met. However, when there is any word document level pop up , bot is unable to handle it and hence fails.
For now, we have the following code which handles pop ups and other such alerts at microsoft word level. MsWord.Application wdApplication = new MsWord.Application(); wdApplication.AutomationSecurity = Microsoft.Office.Core.MsoAutomationSecurity.msoAutomationSecurityForceDisable; wdApplication.DisplayAlerts = WdAlertLevel.wdAlertsNone;
However, when there are pop ups at application level, there is no way I could figure out. The text in pop up: 'Duplicate file is already open by someone and hence cannot be processed';'Call was rejected by callee';'Microsoft Office can't find your license for the repair attempt';'The file is read-only. Do you wish to save it?'