TripScott Posted April 7, 2009 Share Posted April 7, 2009 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 More sharing options...
youknowwho4eva Posted April 7, 2009 Share Posted April 7, 2009 Why not just use filereadline? Giggity Link to comment Share on other sites More sharing options...
TripScott Posted April 7, 2009 Author Share Posted April 7, 2009 Because I don't know what I am doing. 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now