D
D
dpolyakoio2017-04-01 13:25:28
Delphi
dpolyakoio, 2017-04-01 13:25:28

Why does WINWORD.EXE still hang in processes when programmatically closing a Word document?

Hello! Here is a code snippet in Delphi:

var
Word, Doc: OleVariant;
begin
Word:=CreateOleObject('Word.Application');
Doc:=Word.Documents.Open('c:\example.docx');
//действия с документом
Doc.Save;
Doc.Close;
Word:=UnAssigned;
end;

After that, WINWORD.EXE remains hanging in the processes. What to do? Subsequent runs of this procedure add instances of WINWORD.EXE to processes. How to kill them programmatically???

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sumor, 2017-04-01
@dpolyakoio

This is because you closed the document, but did not close the Word.
To close the Word, you need to give it the Quit command.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question