donnyh13 0 Posted August 31, 2015 Hi all, I had created a script back in november with the latest at that time of autoit, it worked and then I didnt need it since. now I have downloaded the latest auto it on a different computer and copied the same script over. it works except for when it get to the spot where its supposed to open a word doc. this wont work. I have tried making a new script solely meant to open a word doc, and cannot get it to open, what am I doing wrong? this is my code,#include <Word.au3> Local $location = InputBox( "Location.", "What is the name of the file including the extension, {for example .rtf}") Sleep ( 3000) Local $WordCreate = _Word_Create() Sleep ( 3000) Local $path = @ScriptDir & "\"&$location Sleep ( 3000) _Word_DocOpen( $WordCreate, $path,)I would normally run the script it would prompt for where its located, which I would enter the name including the extension, for example "open.rtf". which is located in the same place im running my script from. Is there something im missing?? something that changed with a recent update?thanks Share this post Link to post Share on other sites
DakotaSamuel 0 Posted August 31, 2015 Your code has a few typos. Try this:#include <Word.au3> Local $location = InputBox( "Location.", "What is the name of the file including the extension, {for example .rtf}") Local $WordCreate = _Word_Create() Local $path = @ScriptDir & "\" & $location _Word_DocOpen( $WordCreate, $path)And I don't believe the sleeps are needed either. -DakotaSamuel Share this post Link to post Share on other sites
water 2,359 Posted August 31, 2015 When you run your script from SciTE do you get any error messages? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
donnyh13 0 Posted September 1, 2015 Thanks for the replies, Your code has a few typos. Try this:#include <Word.au3> Local $location = InputBox( "Location.", "What is the name of the file including the extension, {for example .rtf}") Local $WordCreate = _Word_Create() Local $path = @ScriptDir & "\" & $location _Word_DocOpen( $WordCreate, $path)And I don't believe the sleeps are needed either. -DakotaSamuelI did try the code, still nothing, I run it and it just runs and goes away, the word I specify doesnt open.no erroes etc. im wondering if it is something to do with my computer? Share this post Link to post Share on other sites
DakotaSamuel 0 Posted September 1, 2015 What versions of Autoit and Word do you have installed? -DakotaSamuel Share this post Link to post Share on other sites
kaisies 20 Posted September 1, 2015 Thanks for the replies, I did try the code, still nothing, I run it and it just runs and goes away, the word I specify doesnt open.no erroes etc. im wondering if it is something to do with my computer? You have no error checking, so It wouldn't report an error.Does this display an error? #include <Word.au3> Local $location = InputBox( "Location.", "What is the name of the file including the extension, {for example .rtf}") Local $WordCreate = _Word_Create() Local $path = @ScriptDir & "\" & $location _Word_DocOpen( $WordCreate, $path) If @Error Then Msgbox(0,'',"_Word_DocOpen returned @error: " & @error) Share this post Link to post Share on other sites
donnyh13 0 Posted September 2, 2015 Hi Kaisies, woops, I thought you meant the syntax check type errors. I tried your code and it returned code 1 The installer says 3.3.12.0 for autoit. I am actually using WPS writer ( which worked before with the old code) that version is 9.1.0.4758Thanks Share this post Link to post Share on other sites
kaisies 20 Posted September 2, 2015 You should look at the doc open udf page and look at what error 1 means 1 donnyh13 reacted to this Share this post Link to post Share on other sites
donnyh13 0 Posted September 8, 2015 (edited) Thanks Kaisies,any hints on how to correct it? as I am not very fluent in all of this code language Edited September 8, 2015 by donnyh13 Share this post Link to post Share on other sites
water 2,359 Posted September 8, 2015 @error = 1 means: $oAppl is not an objectIt looks like _Word_Create already returned an error. I suspect there is no MS Word installed on your machine. 1 donnyh13 reacted to this My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
donnyh13 0 Posted September 9, 2015 Thanks,I really appreciate your help! Share this post Link to post Share on other sites