I'm a new user of AutoIt, and I'd like my first script to open a few files for me. I can open a .txt file and a .pdf file just fine, but when Word opens it can't find the file I've specified. Here's the code I'm using. The same code works fine for the .txt and .pdf files, with file and path modifications:
$program_location = "C:\Program Files (x86)\Microsoft Office\Office12\WINWORD.EXE"
$file_location = "C:\Editing\Editing Contract.docx"
Run ( $program_location & " " & $file_location & "")
Along with the other two files, Word (2007) opens, but in Word an alert appears: "This file could not be found. (C:\Editing\Editing.doc)". Clicking OK opens another alert: "This file could not be found. (C:\Users\Ward\Desktop\Contract.docx)". Clicking OK opens Word with a new, blank document. It looks as if the script has trouble with the space in "Editing Contract.docx", although the other files that open successfully also have spaces in their filenames. Is there a way to comment out the space (I don't want to change the filename).
I'm using Windows 7.