Yossi Mazal Tov
Guest
|
i tried :
case HostType of
ohaExcel : begin
LCID := GetUserDefaultLCID;
ExcelApp.ActiveWindow.Application.ActiveWorkbook.Close(OleVarFalse,EmptyParam,EmptyParam,LCID);
ExcelApp.Quit;
ExcelApp.Disconnect;
end;
ohaWord : begin
WordApp.ActiveDocument.Close(OleVarFalse,EmptyParam,EmptyParam);
WordApp.Quit;
WordApp.Disconnect;
end;
ohaPowerPoint : begin
PowerPointApp.ActivePresentation.Close;
PowerPointApp.Quit;
PowerPointApp.Disconnect;
end;
else
WriteTextFile(LogFileName,'UnNowen File Type - To Close',True);
end;
word,excel work fine.
but powerpoint remain with empty none active windows.
how can i force closing it; |
|
Dmitry Kostochko
Add-in Express team
Posts: 2887
Joined: 2004-04-05
|
Hi Yossi,
I have just tried the following code, it works fine:
ohaPowerPoint: begin
// close all presentations
for i := PowerPointApp.Presentations.Count downto 1 do begin
PowerPointApp.Presentations.Item(i).Saved := msoCTrue;
PowerPointApp.Presentations.Item(i).Close();
end;
PowerPointApp.Quit();
PowerPointApp.Disconnect();
// force Quit
PowerPointApp.Quit();
PowerPointApp.Disconnect();
end;
I tested the code against PowerPoint 2010 and 2013. |
|
Yossi Mazal Tov
Guest
|
well....
// force Quit
PowerPointApp.Quit();
PowerPointApp.Disconnect();
those tow linw did the trick.
Thanks |
|