Code: Select all
var
lComponents, lDocument: OleVariant;
begin
lComponents := FDesktop.GetComponents.CreateEnumeration;
while lComponents.hasMoreElements do
begin
lDocument := lComponents.NextElement;
lDocument.Close(True);
end;
end;
...
//FDesktop is created like so
FDesktop := FLibreOffice.createInstance('com.sun.star.frame.Desktop');