Results 1 to 5 of 5

Thread: Delphi 6

  1. #1
    Join Date
    Apr 2003
    Posts
    4
    Rep Power
    0

    Default Delphi 6

    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?

  2. #2
    Join Date
    Jun 2002
    Posts
    648
    Rep Power
    0

    Default Re:Delphi 6

    What reporting tools do you have installed in Delphi 6?


  3. #3
    Join Date
    Jun 2002
    Posts
    648
    Rep Power
    0

    Default Re: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

  4. #4
    Join Date
    Sep 2002
    Posts
    131
    Rep Power
    0

    Default Re:Delphi 6

    Way to mr RobyG ;D Its a long time I dont see you at Jalug.

    Peace, Kacey

  5. #5
    Join Date
    Jun 2002
    Posts
    648
    Rep Power
    0

    Default Re:Delphi 6

    Have been busy. Saturdays are usually booked out for me...don't mean to 'dis the program

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •