February 23rd, 2015

PowerTip: Troubleshoot a Word Automation Script

Doctor Scripto
Scripter

Summary: Learn to troubleshoot a Windows PowerShell script for Microsoft Word automation.

   I have been struggling with a Windows PowerShell script that automates Word. Every time I run the script, I get an
           error message that says the Word document is locked. What can I do?

   When you test or develop your Windows PowerShell script for Word automation, make sure that you quit the 
            Word.Application object and close the Word document. Otherwise, the document will be locked. This is
            especially true if you set the Application.Visible property to $false.

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.