Jump to content

Recommended Posts

Posted

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.

Posted

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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

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.

Posted

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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

  • 3 weeks later...
Posted

Glad you got your problem solved ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...