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 comment
Share on other sites

  • Developers

You do have MS-Office installed ...right?
Add a comm error handler to get better error info!

Jos 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...