Arnie Posted May 8, 2005 Posted May 8, 2005 I'm a newby and have been playing with this awesome program for the last couple of days. Now I want to run Winword and the Winword doc ''Textexample'', located at the desktop. I get an error that Winword could'nt be found. This is my code: Run("winword.exe") WinWaitActive("Textexample") BTW: with notepad there is no problem. What do I wrong. TIA Arnie
BillLuvsU Posted May 8, 2005 Posted May 8, 2005 Now I want to run Winword and the Winword doc ''Textexample'', located at the desktop.I get an error that Winword could'nt be found.Try going to start/run and type in winword.exe Does it open word? [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw
Developers Jos Posted May 8, 2005 Developers Posted May 8, 2005 just change "winword.exe" to "the.whole.path\winword.exe"...... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Arnie Posted May 8, 2005 Author Posted May 8, 2005 (edited) just change "winword.exe" to "the.whole.path\winword.exe"...... <{POST_SNAPBACK}>OK, now Winword is booting, and I can boot the doc if it is located in C:\My code: Run("C:\program files\microsoft office\office10\winword.exe C:\textexample.doc")Question is what is the computer/user - independent path to the desktop? Edited May 8, 2005 by Arnie
AreS Posted May 8, 2005 Posted May 8, 2005 OK, now Winword is booting, and I can boot the doc if it is located in C:\My code: Run("C:\program files\microsoft office\office10\winword.exe C:\textexample.doc")Question is what is the computer/user - independent path to the desktop?<{POST_SNAPBACK}>C:\Documents and Settings\User.Name\Desktop
Developers Jos Posted May 8, 2005 Developers Posted May 8, 2005 @DesktopDir ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
AreS Posted May 8, 2005 Posted May 8, 2005 @DesktopDir ?<{POST_SNAPBACK}>Ah...where in the documentation would all those locations be?I know that there's @WindowsDir, and now @DesktopDir, but I'd like to know what the others are now too.
Developers Jos Posted May 8, 2005 Developers Posted May 8, 2005 Ah...where in the documentation would all those locations be?I know that there's @WindowsDir, and now @DesktopDir, but I'd like to know what the others are now too. <{POST_SNAPBACK}>Just open the helpfile and check out the AutoIt\Macro reference\Directory macros.. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
AreS Posted May 8, 2005 Posted May 8, 2005 Just open the helpfile and check out the AutoIt\Macro reference\Directory macros.. <{POST_SNAPBACK}>Hoho! Thank you!
Arnie Posted May 9, 2005 Author Posted May 9, 2005 (edited) Thanks for the help guys (BTW: great response).Next code opens a new Word document, not the text.doc.:Run("C:\program files\microsoft office\office10\winword.exe @DesktopDir\Text.doc")I used also: @DesktopCommonDirAnyone? Edited May 9, 2005 by Arnie
MHz Posted May 9, 2005 Posted May 9, 2005 (edited) Thanks for the help guys (BTW: great response).Next code opens a new Word document, not the text.doc.:I used also: @DesktopCommonDirAnyone?<{POST_SNAPBACK}>Try this line:Run(@ProgramFilesDir & "\Microsoft Office\Office10\Winword.exe " & @DesktopDir & "\Text.doc") Edited May 9, 2005 by MHz
Arnie Posted May 9, 2005 Author Posted May 9, 2005 Try this line:Run(@ProgramFilesDir & "\Microsoft Office\Office10\Winword.exe " & @DesktopDir & "\Text.doc")<{POST_SNAPBACK}>Thanks MHz.Unfortunately this does'nt work either.I get (translated) message: can't find documentpath.Anymore suggestions?
MHz Posted May 9, 2005 Posted May 9, 2005 Sorry Arnie, try this. The document path may need inverted comma's. I will cover both desktops also. If you see the messagebox, then it will try the @DesktopCommonDir. $document = @DesktopDir & '\Text.doc' If FileExists($document) Then Run(@ProgramFilesDir & '\Microsoft Office\Office10\Winword.exe "' & $document & '"') Else MsgBox(0, '', 'Using 2nd Choice') $document = @DesktopCommonDir & '\Text.doc' Run(@ProgramFilesDir & '\Microsoft Office\Office10\Winword.exe "' & $document & '"') EndIf
Arnie Posted May 9, 2005 Author Posted May 9, 2005 Thank you very much Mhz, this one works like a charm.
randallc Posted May 9, 2005 Posted May 9, 2005 (edited) Hi, Also; $document = @DesktopDir & '\Text.doc' $directoryExe=@ProgramFilesDir&"\Microsoft Office\Office10\Winword.exe" If StringInStr($document, " ") Then $document = '"' & $document & '"' Run($directoryExe&" "&$document) ** OR else use the "short file name" command on "@DesktopDirectory ** Better to use "if instr" as applies to directory and file names if you use @comspec, or Run Dos commands too Randall Edited May 9, 2005 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
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