//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "PrintExample.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: PrintExample
// Method: ComCtrls.TCustomRichEdit.Print

// BeginCode
/*
Place a button and a richedit on the form.  No print dialog
appears.  The contents of the richedit is printed to the
currently configured printer.
*/
void __fastcall TForm1::FormCreate(TObject *Sender)
{
// you may need to change this path to suit your environment
  char const *Path = "..\\OVERVIEW.RTF";
  RichEdit1->Lines->LoadFromFile(Path);
}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
// The parameter string shows in the print queue under "Document   // name".
  RichEdit1->Print("My Document Name");
}
// EndCode
// EndExample: PrintExample
//---------------------------------------------------------------------------
