Здравствуйте, есть процедура:
Код:
procedure TForm1.Button2Click(Sender: TObject);
begin
PrinterName :=ListBox1.Items[ListBox1.ItemIndex];
Apex.ActiveWorkBook.Sheets.Item[1].printout(1, 1, 1, false, PrinterName);
Apex.DisplayAlerts:=false;
Apex.Quit;
Apex := Unassigned;
ApexI.DisplayAlerts:=false;
ApexI.Quit;
ApexI := Unassigned;
end;
Как выполнять её без использования Button2, просто создать свою процедуру а потом вызвать её?