Jump to content

Pass MS Word variable to AutoIt


Recommended Posts

This seems like something that should be relatively easy, but I can't find any references to it anywhere.

I am having AutoIt run a macro in Word 2003 (on XP). Word will do it's thing and store the data as a variable. How to I get that data into AutoIt?

The Word script just has it read some text in the document and then store the value as valPartNum. I want that to to be stored in AutoIt's variable $sPartnumber.

Any ideas

CODE
$oWordApp = ObjGet("", "Word.Application")

$oWordDoc = ObjGet("", "Word.Application.Documents")

_WordMacroRun($oWordApp, "GetPartNumber")

$sPartnumber = $oWordDoc.script.variablename("valpartnum")

Thanks for any help.

Kristine

Link to comment
Share on other sites

Because I don't know what I am doing. :D

I am not sure how I would write it.

oWordApp = ObjGet("", "Word.Application")
$oWordDoc = ObjName("", "Word.Application.Documents")

$line = FileReadLine($oWordDoc)
_WordMacroRun($oWordApp, "GetPartNumber")
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...