September 20th, 2015

PowerTip: Use PowerShell to Find Title of Foreground Word Document

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to find the title of the foreground Word document.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find the title of the Word document that is currently in the foreground when 
           I have several documents open?

Hey, Scripting Guy! Answer The Get-Process cmdlet with the MainWindowTitle property will list the title of the Word document.
           This example presents the main window title and the start time of the application:

Get-Process winword | select starttime, MainWindowTitle

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.