Jump to content

Unable to Process .docm word document (Macro enabled word document)

Recommended Posts

Hi All,

I have a . docm word document , when I write the below code it give "Variable must be of type "Object".:" Error 

#include <Word.au3>
$oWordApp = _Word_Create("D:\Documents\Word Doc API\Report Guide Sheet.docm")
$oDoc = _Word_DocGet($oWordApp,1)
global $w = $oDoc.Application----> throws error here

;ConsoleWrite(@error "error code is" &@CRLF)

; move there
;$oDoc.Bookmarks("Date 1").Select
; insert content
;$w.Selection.typetext("This is inserted at the bookmark")


Please suggest what  on what mistake I'm doing.

Thanks in advance



Edited by Jos
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...