Board index » delphi » Question about printing a TMemofield

Question about printing a TMemofield

Does anyone know how to print from a TMemo component ???? Maybe an example
???
 

Re:Question about printing a TMemofield


emo schrieb:

Quote
> Does anyone know how to print from a TMemo component ???? Maybe an example
> ???

Hi !

A very simple way is this. It will print each line from your Memo to the
default printer.

var
  MyFile: TextFile;
  i: integer;
begin
  AssignPrn(MyFile);   // This is in Unit Printers
  Rewrite(MyFile);
  for i:=0 to Memo1.Lines.Count-1 do
    Writeln(MyFile, Memo1.Lines[i]);
  System.CloseFile(MyFile);
end;

Ciao,
Marco

Other Threads