WPCubed Product Support

Merged Text lost the header footer and outlines

I'm using the latest 6.x version of the vcl. When I am doing the merge, I lost header/footer or outlines.

Scenario #1 (this code Lost both of the header/footer and outline)
WprichText1.OpenDialog(wpdiaload);
wpRichtext1.clearEx(true, false,true);
Wprichtext1.mergeText;
wprichtext2.fastAppendText(wprichtext1,false);

Scenario #2 (this code Lost the header/footer, outline is correct)
WprichText1.OpenDialog(wpdiaload);
wpRichtext1.clearEx(true, false,true);
Wprichtext1.mergeText;
wprichtext2.heder.assign(wprichtext1.header);
wprichtext2.fastAppendText(wprichtext1,false);

scenario #3 (this code lost the outline, the header/footer is correct)
WprichText1.OpenDialog(wpdiaload);
wpRichtext1.clearEx(true, false,true);
Wprichtext1.mergeText;
wprichtext2.hederfooter.assign(wprichtext1.headerfooter);
wprichtext2.fastAppendText(wprichtext1,false);

What is correct coding to keep both? I have tried a few other way, but not successfull. I must missing something on the coding. Please HELP...

#1 ♥ 0
6.8k Views 2 users read 3 min

correction on the code sample code send...

I'm using the latest 6.x version of the vcl. When I am doing the merge, I lost header/footer or outlines.

Scenario #1 (this code Lost both of the header/footer and outline)
WprichText1.OpenDialog(wpdiaload);
wpRichtext2.clearEx(true, false,true);
Wprichtext1.mergeText;
wprichtext2.fastAppendText(wprichtext1,false);

Scenario #2 (this code Lost the header/footer, outline is correct)
WprichText1.OpenDialog(wpdiaload);
wpRichtext2.clearEx(true, false,true);
Wprichtext1.mergeText;
wprichtext2.heder.assign(wprichtext1.header);
wprichtext2.fastAppendText(wprichtext1,false);

scenario #3 (this code lost the outline, the header/footer is correct)
WprichText1.OpenDialog(wpdiaload);
wpRichtext2.clearEx(true, false,true);
Wprichtext1.mergeText;
wprichtext2.hederfooter.assign(wprichtext1.headerfooter);
wprichtext2.fastAppendText(wprichtext1,false);

What is correct coding to keep both? I have tried a few other way, but not successfull. I must missing something on the coding. Please HELP...

#2 ♥ 0
support

This is what the MailM4 demo does:

AllRTFText.AsString := WPRichText1.AsString;
AllRTFText.ClearBody;

Table1.First;

while not Table1.EOF do
   begin
      ProgressBar1.Position := i;
      WPRichText1.MergeText;
      begin
         Section := AllRTFText.FastAppendText(WPRichText1,true, [wpCreateNewPage]);
         Section.Select := [wpsec_ResetOutlineNums, wpsec_ResetPageNumber];
      end;
      Application.ProcessMessages;
      Table1.Next;
      inc(i);
   end;
#3 ♥ 0

The outline still doesn't work (the bullets are missing). And the page header/footer doesn't display:

Here is the code:

WPRichText2.asString:=WpRichText1.asString;
WpRichText2.clearBody;

while not vTable.eof do begin
wpirchText1.mergeText;
section:=wpRichText2.FastAppendText(wpRichText1,true,[wpCreateNewPage]);
section.Select:=[wpsec_resetOutlineNums, wpsec_resetPageNumber];
vTable.next;
end;

Result:
Header/footer merged (the page number is not correct. Always show page 1).

The outline is indented correctly, but the bullet indicator (solid dot) is missing.

#4 ♥ 0

If I comment out the code following code:

//WPRichText2.asString:=WPRichText1.asString;

All outlines are merged correctly. However, the footer/header are not showing.

#5 ♥ 0
This category is archived. No new posts are possible.