Jump to content

MS Word window not recognised by WinWait


Recommended Posts

Hello Everyone,

I have been enjoying learning AutoIt.

I am automating a process where a document in Microsoft Document Imaging is output to MS Word.

What I am wanting to do is detect when the Word document is open, so I can close Microsoft Document Imaging.

The problem is that WinWait or WinWaitActive is not detecting the open Word document. I have attached the extract of my code.

Any suggestions would be appreciated.

;Microsoft Office Document Imaging
WinWaitActive("Tasks List - TTA ITAM Rsev.mdi - Microsoft Office Document Imaging")
;Send to Word
ControlClick("Tasks List - TTA ITAM Rsev.mdi - Microsoft Office Document Imaging","","[CLASS:ToolbarWindow32;INSTANCE:3]","left",1,293,15)
WinWaitActive("Send Text To Word")
;Click ok
ControlClick("Send Text To Word","","[CLASS:Button; INSTANCE:6]")
;Redo OCR
WinWaitActive("Microsoft Office Document Imaging")
ControlClick("Microsoft Office Document Imaging","","[CLASS:Button; INSTANCE:1]")
;Wait for Word to open
WinWait("Tasks List - TTA ITAM Rsev.htm - Microsoft Word")
;CLose 
WinActivate("Tasks List - TTA ITAM Rsev.mdi - Microsoft Office Document Imaging")
WinWaitActive("Tasks List - TTA ITAM Rsev.mdi - Microsoft Office Document Imaging")
WinClose("Tasks List - TTA ITAM Rsev.mdi - Microsoft Office Document Imaging")
Link to comment
Share on other sites

It might not be the Waits, try it this way. Notice the difference?, the ClassnameNN value, instead of the Advanced (Class) value, is used in the ControlClick parameters.

;Microsoft Office Document Imaging
WinWaitActive("Tasks List - TTA ITAM Rsev.mdi - Microsoft Office Document Imaging")
;Send to Word
ControlClick("Tasks List - TTA ITAM Rsev.mdi - Microsoft Office Document Imaging","","ToolbarWindow323","left",1,293,15)
WinWaitActive("Send Text To Word")
;Click ok
ControlClick("Send Text To Word","","Button6")
;Redo OCR
WinWaitActive("Microsoft Office Document Imaging")
ControlClick("Microsoft Office Document Imaging","","Button1")
;Wait for Word to open
WinWait("Tasks List - TTA ITAM Rsev.htm - Microsoft Word")
;CLose 
WinActivate("Tasks List - TTA ITAM Rsev.mdi - Microsoft Office Document Imaging")
WinWaitActive("Tasks List - TTA ITAM Rsev.mdi - Microsoft Office Document Imaging")
WinClose("Tasks List - TTA ITAM Rsev.mdi - Microsoft Office Document Imaging")
Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

Thanks somdcomputerguy.

I tried your modifications, but still have the same problem.

The Word document opens, but is not detected.

I did notice however, it seemed to go smoother up to that point. Would that be the case?

I am copying the window title from AutoIt Window Info, so it should be correct. I have also tried using the class of OpusApp to find it, as well. No avail.

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...