Hello, I am new to PowerShell and I am trying to learn to manipulate MS word with PowerShell.
Below are the commands that I ran:
PS C:\WINDOWS\system32> $Word = New-Object –comobject Word.Application
PS C:\WINDOWS\system32> $Document = $Word.documents.open( $Filename )
Object reference not set to an instance of an object.
At line:1 char:1
- $Document = $Word.documents.open( $Filename )
+ CategoryInfo : OperationStopped: (:) , NullReferenceException + FullyQualifiedErrorId : System.NullReferenceException
However, I have encountered an error and I do not know how to resolve it. I would appreciate it if someone could help me with this. Thank you.