V
Volker Schillings
Hi,
I want to disable the AutoMacro functionality, while opening word documents
via word com object. I used following code to do this:
$services = @(Get-Service)
$msWord = new-object -ComObject "word.application" -ea silentlycontinue
$msWord.Application.DisplayAlerts = $false;
$msWordBasic = $msWord.WordBasic
$msWordBasic.GetType().InvokeMember("DisableAutoMacros",[System.Reflection.BindingFlags]::SetProperty,$null,$msWordBasic,1)
$wordDoc = $msWord.Documents.Open("somedocument.doc")
....
I am using Word 2003 and Powershell 1. When I run these lines of code, I
always get an exception. Does anybody knows how to disable the automacros
with powershell?
Best wishes!
Volker
I want to disable the AutoMacro functionality, while opening word documents
via word com object. I used following code to do this:
$services = @(Get-Service)
$msWord = new-object -ComObject "word.application" -ea silentlycontinue
$msWord.Application.DisplayAlerts = $false;
$msWordBasic = $msWord.WordBasic
$msWordBasic.GetType().InvokeMember("DisableAutoMacros",[System.Reflection.BindingFlags]::SetProperty,$null,$msWordBasic,1)
$wordDoc = $msWord.Documents.Open("somedocument.doc")
....
I am using Word 2003 and Powershell 1. When I run these lines of code, I
always get an exception. Does anybody knows how to disable the automacros
with powershell?
Best wishes!
Volker