AutoitMike Posted March 7, 2012 Share Posted March 7, 2012 (edited) I can attach to a word document using the search text and file name modes in a test environment (just to see if it works). However, I only know the file handle (which I get from WinList) and I know the title. Using the handle and Title modes just wont work. $WordApp = _WordAttach ("Doc text, "Text")----------------> this works, cant use it $WordApp = _WordAttach ("Doc22.doc", "FileName")-----> this works, cant use it $WordApp = _WordAttach ("0x001B0402", "HWND")-------> No Go!!!!! $WordApp = _WordAttach ("Titlebar text", "Title")----------> No Go!!!!! Thanks for any help Edited March 7, 2012 by AutoitMike Link to comment Share on other sites More sharing options...
Spiff59 Posted March 7, 2012 Share Posted March 7, 2012 (edited) Change the "My Doc" test in here to match your doc name and see if it works... #include <Array.au3> #include <Word.au3> $list = winlist() _ArrayDisplay($list) For $x = 1 to $list[0][0] If $list[$x][0] = "My Doc - Microsoft Word" Then $handle = $list[$x][1] ; My Doc.doc is open at runtime Exitloop EndIf Next $oWord = _WordAttach($handle, "HWND") If IsObj($oWord) then MsgBox(0,"","Success!") If it does not, then post the code you're testing with, and tell us what OS and version of Office you're running, and I'm sure someone will fix you up. Edited March 7, 2012 by Spiff59 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