﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
2216	_WordAttach to closed Word doc crashes latest beta but OK for latest stable	Tippex		"_WordAttach to an already closed Word document crashes latest beta (application terminated)with the following error:

""C:\Program Files\AutoIt3\beta\Include\Word.au3"" (228) : ==> Variable must be of type ""Object"".:
$o_windows = $o_Result.Application.Windows
$o_windows = $o_Result^ ERROR
->14:52:13 AutoIT3.exe ended.rc:1

It is tolerated in latest stable (production) version.

The purpose of the code that follows is just to make doubley sure that Word has successfully exited, both by attempting to attach to it and by killing its process.

{{{
$Word.Quit

$oWordApp = _WordAttach(""I:\"" & StringLower($CmpNameCode) & ""\"" & StringTrimLeft(@YEAR, 2) & ""_"" & @MON & ""_"" & @MDAY & ""\"" & $PackageLine & "".doc"")

If Not @error Then

_WordQuit($oWordApp, -1)

EndIf

; Will return the PID or 0 if the process isn't found.

$PID = ProcessExists(""WINWORD.exe"")

If $PID Then ProcessClose($PID)

$Word = """"
}}}

The application crashes if beta compiled and $Word.Quit has succeeded but not if it has been compiled with the latest stable.
"	Bug	closed		Standard UDFs	3.3.9.4	None	Wont Fix	_WordAttach	
