#include #include #include Local $hTimer = TimerInit() ; Begin the timer. ; Create application object Local $oWord = _Word_Create() ; Open an existing file and return its object identifier. Local $sWorkbook = @ScriptDir & "\" & "Word2MB.doc" Local $oWorkbook = _Word_DocOpen($oWord, $sWorkbook, Default, Default, True) ; Print the file _Word_DocPrint($oWorkbook) ; Save the file. Different filename to confirm the write. ;_Word_DocSaveAs($oWorkbook, @ScriptDir & "\" & "Word2MBWrite.doc", Default, True) ; Quit Word _Word_Quit($oWord) ; Calculate time. Local $fDiff = TimerDiff($hTimer) $fDiff=Round(TimerDiff($hTimer)/1000,2) $Show =StringFormat ("%.2f",$hTimer) ; Write time into log file. Appends the file each run. $file = FileOpen(@ScriptDir & "\" & "Word2MBPrintTime.txt", 1) FileWrite($file, $fDiff & " seconds" & @CRLF) FileClose($file) ; Optional Message box with elapsed time. ;Local $iTimeout = 5 ;MsgBox($MB_SYSTEMMODAL, "Timer", $fDiff & " Seconds", $iTimeout)