Hi,
I'm trying to make a preview of several letters. These letters, I first concatenate to 1 WPCustomRichText, each letter in 1 section.
The header I want to put at the first page of each letter and the footer at the last page of each letter WITHIN every section. But it shows only the first header of the first section and the last footer of the last section.
This worked fine with a older version of WPTools5 (2006), but not with the latest version. (How) can I fix this? I'm using Delphi 5.
Dirk.
Example with 2 letters (and thus 2 sections):
Code
procedure TForm1.btnTestPreview1Click(Sender: TObject);
var
par:TParagraph;
wpall,wp1,wp2:TWPCustomRichText;
begin
wpall := TWPCustomRichText.CreateDynamic;
wp1 := TWPCustomRichText.CreateDynamic;
wp2 := TWPCustomRichText.CreateDynamic;
// DOC 1
par := wp1.FirstPar;
par.SetText('HEADER 1');
wp1.HeaderFooter.Get(wpHeader,wpraOnFirstPage,'HEADER 1').AppendPar(par);
par := wp1.ActiveText.AppendNewPar(True);
par.SetText('BODY 1');
par := wp1.ActiveText.AppendNewPar(True);
par.SetText('FOOTER 1');
wp1.HeaderFooter.Get(wpFooter,wpraOnLastPage,'FOOTER 1').AppendPar(par);
// DOC 2
par := wp2.FirstPar;
par.SetText('HEADER 2');
wp2.HeaderFooter.Get(wpHeader,wpraOnFirstPage,'HEADER 2').AppendPar(par);
par := wp2.ActiveText.AppendNewPar(True);
par.SetText('BODY 2');
par := wp2.ActiveText.AppendNewPar(True);
par.SetText('FOOTER 2');
wp2.HeaderFooter.Get(wpFooter,wpraOnLastPage,'FOOTER 2').AppendPar(par);
wpall.AppendAsSection(wp1);
wpall.AppendAsSection(wp2);
wpall.ReformatAll(true);
// PREVIEW
with TWPPreviewDlg.Create(Application) do
begin
EditBox:= wpall;
Execute;
Free;
end; // WITH
FreeAndNil(wp1);
FreeAndNil(wp2);
FreeAndNil(wpall);
end;
Alles anzeigen