What i want to do is to transform a .doc or .xls into .pdf
I tried to print to a pdf-printer as distiller or PSprinter + GostScript + FreeDist and it's ok but i should like that the parent application (word and excel) doesn't open.
Any suggestion?
Thanks
The Formula One spreadsheet that ships with Delphi can read .XLS files. It is lighterweight than Excel, so it starts instantly, is easily distributable but does not handle all Excel features.
will read Word files. It has a PDF writer as a cost option, which I also use with great success. You could probably output from Formula One to wpPDF, but I haven't tried that myself.
Thank's Simon
I think OLE may be a solution. I don't know OLE yet but i go to study it.
I'm afraid WPTools is expensive for me so if i find how to print using your sample code .....
Giovanni
In some manner i solved.
Parent application is open but it's not visible.
I post here my code. May be it's useful to someboby.
uses comobj;
procedure TForm1.Button1Click(Sender: TObject);
var MyExcel: olevariant;
begin
MyExcel:=UnAssigned;
MyExcel:=CreateOleObject('Excel.Application');
Try
MyExcel.Visible:=false;
MyExcel.WorkBooks.open('..\cartel1.xls');
MyExcel.WorkSheets.Printout;
Finally
if not varisempty(MyExcel) then
begin
MyExcel.quit;
MyExcel := unassigned;
end;
end;
end;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.