I wrote a script to check for Excel Macro’s that returns TRUE if a document contains a macro. I then wanted to reuse the code of Word Macro’s but its returning false even for documents I created a macro in (see code below). What am I doing wrong?
$word = new-object -comobject word.application
$doc = $word.documents.Open(“C:\Path\example.docm”)