Modify

Opened 14 years ago

Closed 14 years ago

#2216 closed Bug (Wont Fix)

_WordAttach to closed Word doc crashes latest beta but OK for latest stable

Reported by: Tippex Owned by:
Milestone: Component: Standard UDFs
Version: 3.3.9.4 Severity: None
Keywords: _WordAttach Cc:

Description

_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.

Attachments (0)

Change History (2)

comment:1 by trancexx, 14 years ago

Component: AutoItStandard UDFs

comment:2 by water, 14 years ago

Resolution: Wont Fix
Status: newclosed

Bad coding style. Close the document and check if it was successfull. If it was then there's no need to double check.
As the Word UDF is being rewritten we won't fix this.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.