Her lidt code som kan afhjælpe dit problem
Mvh OW
unit testrich;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, printers;
type
TForm1 = class(TForm)
UdskrivRichEdit: TRichEdit;
Memo1: TMemo;
Button1: TButton;
procedure FormActivate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
Procedure printout;
Procedure PrepMemo;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
Procedure TForm1.printout;
Var
Line : integer;
space : integer;
begin
Printer.BeginDoc;
with Printer.Canvas do
begin
space := abs(printer.Canvas.Font.Height);
space := space + (space div 2);
for Line := 0 to UdskrivRichEdit.Lines.Count -1 do // Her ønskes udskrives Adressen til
begin
TextOut(1000,1000+(line * space),UdskrivRichEdit.Lines.Strings[Line]);
end;
with Printer.Canvas do
begin
for Line := 0 to UdskrivRichEdit.Lines.Count -1 do
begin
TextOut(2000,2000+(line * space),Memo1.Lines.Strings[Line]); // Her ønskes udskrives afsenderadressen
end;
end;
Printer.EndDoc;
end;
end;
//uses ComCtrls;
//procedure TForm1.FormCreate(Sender: TObject);
Procedure TForm1.PrepMemo;
begin
// with TRichEdit.Create(Self) do
with form1.UdskrivRichEdit do
begin
// Parent := Self;
// Align := alClient;
Lines.Clear;
// set numbering style
Paragraph.Numbering := nsBullet;
Lines.Add('Introduction');
Lines.Add('New members to our team');
Lines.Add('New Budget discussion');
Lines.Add('Facilities');
Lines.Add('Q & A');
Paragraph.Numbering := nsNone;
Paragraph.Alignment := taCenter;
Lines.Add('');
Lines.Add('Suggested Topics:');
Lines.Add('');
Paragraph.Alignment := taLeftJustify;
Paragraph.FirstIndent := 10;
Lines.Add('');
Lines.Add('Parking lot repair');
Lines.Add('Cost overruns');
end;
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
prepmemo;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
printout;
end;
end.