*alang(阿朗)(40480843) 11:05:52
delphi代码
var
word: OleVariant;
begin
word := CreateOleObject('Word.Application');
showmessage('before quit');
word.Quit(EmptyParam, EmptyParam, EmptyParam);
showmessage('after quit');
*alang(阿朗)(40480843) 11:06:11
平台代码:
var
o: Object;
word: System.DispatchHelper;
begin
o := ComObj.CreateOleObject('Word.Application');
word := System.DispatchHelper.Create(o);
Dialogs.showmessage('before quit');
word.InvokeMethod('Quit', [nil, nil, nil]);
dialogs.showmessage('after quit');
(o as System.IDisposable).Dispose;
*alang(阿朗)(40480843) 11:06:14
是可以的 |