Return list of Opened Word Documents on PC

First time here.

I’ve tried to find an existing script but have been unable.
My scenario is that I might have quite a number of Word Documents opened on my PC. And, I need to alter some Advanced Property Fields in one of the opened document. However, currently I need to provide either the full name of the file or a unique portion of the document name. And, I would like to present a list of open documents and the user will choose the one to be modified.

Please let me know if anyone here can point me to a possible solution.


Hi, welcome to the forum :wave:

As suggested here:

You could then use the Out-GridView with the PassThrough parameter for the user selection:

$word = [Runtime.Interopservices.Marshal]::GetActiveObject('Word.Application')
$word.Documents | Select-Object Name | 
    Out-GridView -Title 'Select a Document' -PassThru