I have a strange issue and wonder if anyone has any ideas. I am trying to make a powershell script that can replace text in a word document.
This script works fine on version 5 but not on version 7
How to use Powershell to replace text in Word which is in single line and different line?
The problem is the command
New-Object -ComObject word.application
In version 5 it works, but in version 7 I get
New-Object: Cannot create type. Only core types are supported in this language mode.
In both shells I get that the languagemode is Constrained.
PS C:\Windows\System32> $ExecutionContext.SessionState.LanguageMode
ConstrainedLanguage
Any ideas?