imprimir con dialogo
Un saludo.
Trato de imprimir el contenÃdo de un richedit .
no se como hacerlo, he intentado esto y me imprime el interfaz del programa
procedure TForm1.Button2Click(Sender: TObject);
begin
if PrintDialog1.Execute then Print ;
end;
He estado haciendo prubas con esto pero no llego ni ha compilar simpre me da diferentes errores. Agradeceria
una ayuda.
Gracias
Trato de imprimir el contenÃdo de un richedit .
no se como hacerlo, he intentado esto y me imprime el interfaz del programa
procedure TForm1.Button2Click(Sender: TObject);
begin
if PrintDialog1.Execute then Print ;
end;
He estado haciendo prubas con esto pero no llego ni ha compilar simpre me da diferentes errores. Agradeceria
una ayuda.
Gracias
Tu mensaje es un poco antiguo, por lo que igual has solucionado el problema. De todas formas, voy a responder con un ejemplo
uses Printers:
procedure TForm1.Button2Click(Sender: TObject);
var
PrintText: TextFile;
i: integer;
begin
if PrintDialog1.Execute then begin
AssignPrn(PrintText);
Rewrite(PrintText);
i := 0;
while i <= richedit1.Lines.Count - 1 do begin
WriteLn(PrintText, richedit1.Lines[i]);
Inc(i);
end;
CloseFile(PrintText);
end;
uses Printers:
procedure TForm1.Button2Click(Sender: TObject);
var
PrintText: TextFile;
i: integer;
begin
if PrintDialog1.Execute then begin
AssignPrn(PrintText);
Rewrite(PrintText);
i := 0;
while i <= richedit1.Lines.Count - 1 do begin
WriteLn(PrintText, richedit1.Lines[i]);
Inc(i);
end;
CloseFile(PrintText);
end;
