Arnie Posted May 8, 2005 Share 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 Link to comment Share on other sites More sharing options...
BillLuvsU Posted May 8, 2005 Share 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted May 8, 2005 Developers Share 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. Link to comment Share on other sites More sharing options...
Arnie Posted May 8, 2005 Author Share 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 Link to comment Share on other sites More sharing options...
AreS Posted May 8, 2005 Share 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted May 8, 2005 Developers Share 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. Link to comment Share on other sites More sharing options...
AreS Posted May 8, 2005 Share 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. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 8, 2005 Developers Share 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. Link to comment Share on other sites More sharing options...
AreS Posted May 8, 2005 Share Posted May 8, 2005 Just open the helpfile and check out the AutoIt\Macro reference\Directory macros.. <{POST_SNAPBACK}>Hoho! Thank you! Link to comment Share on other sites More sharing options...
Arnie Posted May 9, 2005 Author Share 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 Link to comment Share on other sites More sharing options...
MHz Posted May 9, 2005 Share 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 Link to comment Share on other sites More sharing options...
Arnie Posted May 9, 2005 Author Share 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? Link to comment Share on other sites More sharing options...
MHz Posted May 9, 2005 Share 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 Link to comment Share on other sites More sharing options...
Arnie Posted May 9, 2005 Author Share Posted May 9, 2005 Thank you very much Mhz, this one works like a charm. Link to comment Share on other sites More sharing options...
randallc Posted May 9, 2005 Share 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 Link to comment Share on other sites More sharing options...
Arnie Posted May 9, 2005 Author Share Posted May 9, 2005 Thanks a lot randallc. Link to comment Share on other sites More sharing options...
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