computelgt Posted May 21, 2012 Share Posted May 21, 2012 Hello is there a way to autosave all open word docments to MyDocs every 5 min. The reason I need a real saved copy instead the autosave option in MsWord does not really save a copy. Link to comment Share on other sites More sharing options...
water Posted May 21, 2012 Share Posted May 21, 2012 You can either use the Word UDF that comes with AutoIt. Or write the code yourself (I can provide some assistance here). My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
computelgt Posted May 24, 2012 Author Share Posted May 24, 2012 I would apreciate any help I would like for it to save all open word documents to MyDocs every 5min. I used the search function on this forum like I always do this is the first time I cant find an answer. Link to comment Share on other sites More sharing options...
water Posted May 24, 2012 Share Posted May 24, 2012 Something like this? $oWord_Error = ObjEvent("AutoIt.Error", "_Word_ErrorHandler") ; Creates a custom error handler $oWord_Appl = ObjGet("", "Word.Application") ; Connect to the Word application If @error Then Exit MsgBox(16, "Error", "Error returned when connecting to the Word application. @error = " & @error) For $oWord_Doc In $oWord_Appl.Documents ; Loop through all documetns $oWord_Doc.Save ; Save the document If @error Then Exit MsgBox(16, "Error", "Error returned when saving document " & $oWord_Doc.FullName & ". @error = " & @error) Next Exit Func _Word_ErrorHandler() Local $bHexNumber = Hex($oWord_Error.number, 8) Local $sWord_Error = "COM Error Encountered in " & @ScriptName & @CRLF & _ "@AutoItVersion = " & @AutoItVersion & @CRLF & _ "@AutoItX64 = " & @AutoItX64 & @CRLF & _ "@Compiled = " & @Compiled & @CRLF & _ "@OSArch = " & @OSArch & @CRLF & _ "@OSVersion = " & @OSVersion & @CRLF & _ "Scriptline = " & $oWord_Error.scriptline & @CRLF & _ "NumberHex = " & $bHexNumber & @CRLF & _ "Number = " & $oWord_Error.number & @CRLF & _ "WinDescription = " & StringStripWS($oWord_Error.WinDescription, 2) & @CRLF & _ "Description = " & StringStripWS($oWord_Error.description, 2) & @CRLF & _ "Source = " & $oWord_Error.Source & @CRLF & _ "HelpFile = " & $oWord_Error.HelpFile & @CRLF & _ "HelpContext = " & $oWord_Error.HelpContext & @CRLF & _ "LastDllError = " & $oWord_Error.LastDllError MsgBox(64, "Word UDF - Debug Info", $sWord_Error) EndFunc ;==>_Word_ErrorHandler My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
computelgt Posted June 9, 2012 Author Share Posted June 9, 2012 Thank you I have been using yout autoit code and it seems to be working just fine. Link to comment Share on other sites More sharing options...
water Posted June 9, 2012 Share Posted June 9, 2012 Glad you got your problem solved My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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