Document saved: C:\Users\doc\AppData\Roaming\word example\Report.docx
New-Object : Retrieving the COM class factory for component with CLSID {00000000-0000-0000-0000-000000000000} failed
due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
At line:1 char:17
+ ; & {$objWord = New-Object -ComObject word.application;$document ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable:

) [New-Object], COMException
+ FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand
You cannot call a method on a null-valued expression.
At line:1 char:56
+ ... application;$document = $objWord.Documents.open('C:\Users\doc\AppDat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation:

) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At line:1 char:152
+ ... rt.docx'); $document.SaveAs([ref] 'C:\Users\doc\AppData\Roaming\word ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation:

) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At line:1 char:245
+ ... ing\word example\Report.pdf', [ref] 17); $document.Close();$objWor ...
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation:

) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At line:1 char:263
+ ... example\Report.pdf', [ref] 17); $document.Close();$objWord.Quit()}
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation:

) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull