Help!! Does anyone know how to print the contents of a text file without having to copy to a rich edit? Need your response ASAP. In deep trouble. If it has to be copied to the rich edit first can you tell me how to go about doing that?
Help!! Does anyone know how to print the contents of a text file without having to copy to a rich edit? Need your response ASAP. In deep trouble. If it has to be copied to the rich edit first can you tell me how to go about doing that?
What reporting tools do you have installed in Delphi 6?
I am using Delphi 7 Enterprise, but the following should still work in Delphi 6:
The easiest thing to do:
Drop a rich edit control unto a form .
Name the form "frmPrint" .
and name the richedit control "richedit" .
Set Visible property of richedit to False .
Now use the following example code to print the contents of your text file:
procedure TfrmPrint.PrintText();
var
Path: string;
begin
Path := 'c:\temp\test.txt';
with richedit do
begin
PlainText := true;
Lines.LoadFromFile(Path);
Print('My Text Document'
end;
end;
You can then execute the procedure "PrintText" in order to print the contents of your file.
If you had to print a RTF file then the above code could still be used
but you would have to set the PlainText property to false.
I hope this helps and remember to sweeten to taste
;D
Way to mr RobyG ;D Its a long time I dont see you at Jalug.
Peace, Kacey
Have been busy. Saturdays are usually booked out for me...don't mean to 'dis the program