Blackholyman wrote:the ComObjGet gets the document object but ComObjActive gets the word window object so you need to tell it the document to get the range from
Code: Select all
F2::
oWord := ComObjActive("Word.Application")
msgbox % oWord.ActiveDocument.range.text
return
thank you, it Works, but now the code is very lame. I need to set sleep on almost 10 Seconds, and get a Word document visible before I can read it... Is there any other solutions how I can avoid it?
my code now:
Code: Select all
runwait, http://team/`%20rapporter.docx
sleep 10000
oWord := ComObjActive("Word.Application")
msgbox % oWord.ActiveDocument.range.text
return
I want to have something like this (doesn't work...)
Code: Select all
oWord := ComObjCreate("Word.Application")
oWord.Visible := false
oWord.Navigate("http://team/`%20rapporter.docx")
msgbox % oWord.ActiveDocument.range.text