Jump to content

Recommended Posts

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 by AutoitMike
Link to post
Share on other sites

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

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
$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 by Spiff59
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...