PSWriteOffice icon indicating copy to clipboard operation
PSWriteOffice copied to clipboard

Close-OfficeWord unable to close an open worddoc without a valid WordDoc object being passed.

Open AspenForester opened this issue 1 year ago • 0 comments

The syntax for Close-OfficeWord suggests that the -Document parameter is optional. That would lead one to believe that if they had done an Get-OfficeWord without assigning the output to a variable, that they could then simply execute Close-OfficeWord to close it again, but that doesn't appear to be the case.

Additionally, should one's script error before having a chance to close a previously opened document, that document is held in limbo until the PowerShell session is closed.

AspenForester avatar Apr 22 '24 20:04 AspenForester