WPCubed Product Support

Mailmerge tables lose insertion points after streaming

I have a project where a mergefield retrieves a table built within another WPRichText.

Contents.StringValue := WPRichText2.AsString;

It works great, even when MergeText is called repeatedly. However, after saving and then reloading the text to/from a stream, the insertion points are messed up, causing the table to show twice.

WPRichText1.SaveToStream(Stream);
Stream.Position := 0;
WPRichText1.LoadFromStream(Stream,'',True);

I have a sample project, if I can find a way to attach it. Here's a link to it: [](http://jcent.com/MergeTable.zip)

#1 ♥ 0
6.2k Views 1 links 3 users read 2 min

OK, the problem goes away when using the "WPTOOLS" format when loading/saving the stream. This works for me.

#2 ♥ 0
support

Hi,

yes, this is a solution for now. There is bug, it looses the closing insretpoint unless there is a character or paragraph before it. The field should not end with a table.

Julian

#3 ♥ 0

Hi,

Any news on this topic? I'm having this same problem with tables before the closing insertpoint and saving as WPTools is not a option to me. I save as rtf.
I'm using WPTools 5.43 by the way.

Thanks.

#4 ♥ 0
support

Hi,

please locate this code in WPIOREadRTF.PAS and insert the marked line

if FCurrentParagraph.ParagraphType = wpIsTable then
begin
NewParagraph();
FLastWasSTDPar := false;
TableVar[TableDepth].FInsideTable := FALSE;//<---
end;

Thats about at line 2648

Julian

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