windows - How to openfile in special program using autoit? -


i need open file in special program. example, need open *.docx file if office word.

i have figured out how run office

example()  func example()     ; run notepad window maximized.     local $ipid = run("c:\program files (x86)\microsoft office\office15\winword.exe", "", @sw_showmaximized)      ; wait 10 seconds notepad window appear.     winwait("[class:winword]", "", 5)      ; wait 2 seconds.     sleep(2000)      ; close notepad process using pid returned run.     processclose($ipid) endfunc   ;==> 

how open file?

for word documents, pass name of document command line argument

example()  func example()     ; run notepad window maximized.     local $ipid = run("c:\program files (x86)\microsoft office\office15\winword.exe" & " " & "path_to_document", "", @sw_showmaximized)      ; wait 10 seconds notepad window appear.     winwait("[class:winword]", "", 5)      ; wait 2 seconds.     sleep(2000)      ; close notepad process using pid returned run.     processclose($ipid) endfunc   ;==> 

or use shellexecute()


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -