Jump to content
Sign in to follow this  
TripScott

Pass MS Word variable to AutoIt

Recommended Posts

TripScott

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

Share this post


Link to post
Share on other sites
youknowwho4eva

Why not just use filereadline?


Giggity

Share this post


Link to post
Share on other sites
TripScott

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")

Share this post


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
Sign in to follow this  

×