WPCubed Product Support

Table in mergefield, RTF Reader displaces the mergefield

I've saved the following RTF from a TWPRichtext. The table is inserted into the mergefield using the mergetext routine.

{\rtf1\ansi\deff0\uc1\ansicpg1252\deftab720{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset0 Arial;}{\f2\fnil\fcharset1 Wingdings;}{\f3\fnil\fcharset0 Univers;}{\f4\fnil\fcharset0 Arial Black;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;\red230\green230\blue230;\red128\green128\blue0;}\wpprheadfoot1\paperw12240\paperh15840\margl1880\margr1880\margt1440\margb1440\headery720\footery720\endnhere\sectdefaultcl{\\generator WPTools_5.350;}{\\userprops {\propname papername}\proptype30{\staticval Letter} }{\pard\plain\plain\fs22\par \pard\plain\plain\fs22\par \plain\fs22 TEST\par \pard\plain\plain\fs22\par \plain\fs22{\field{\\fldinst{MERGEFIELD recxml_sndAdressen|TXMLAddressListbox_LSTTABLE$COL#Adres}}{\\wpfldparam{[recxml_sndAdressen|TXMLAddressListbox_LSTTABLE$COL#Adres]}}{\fldrslt{\par \tblstart1{\trowd\trleft0\trbrdrl\brdrs\trbrdrr\brdrs\trbrdrt\brdrs\trbrdrb\brdrs\trftsWidth2\trwWidth5000\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\clbrdrt\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clcbpat13\clftsWidth3\clwWidth4230\clvertalt\cellx4230\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\clbrdrt\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clcbpat13\clftsWidth3\clwWidth4230\clvertalt\cellx8460\pard\intbl\itap1\li0\fi0\ri0\sb0\sa0\ql\clcbpat13\plain\fs22 zakelijk\cell\pard\intbl\itap1\li0\fi0\ri0\sb0\sa0\ql\clcbpat13\plain\fs22 Hazestraat 1 5555 AB VALKENSWAARD\cell\row}{\trowd\trleft0\trbrdrl\brdrs\trbrdrr\brdrs\trbrdrt\brdrs\trbrdrb\brdrs\trftsWidth2\trwWidth5000\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\clbrdrt\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clcbpat13\clftsWidth3\clwWidth4230\clvertalt\cellx4230\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\clbrdrt\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clcbpat13\clftsWidth3\clwWidth4230\clvertalt\cellx8460\pard\intbl\itap1\li0\fi0\ri0\sb0\sa0\ql\clcbpat13\plain\fs22\cell\pard\intbl\itap1\li0\fi0\ri0\sb0\sa0\ql\clcbpat13\plain\fs22 Kastanjelaan 1 6666 AA HETEREN\cell\row}\tblend1\pard\plain\plain\fs22}}}\par \pard\plain\plain\fs22\par \plain\fs22 TEST\par \pard\plain\plain\fs22\par \pard\plain\plain\fs22\par }}

If i load this file into the same WpTools editor and use mergetext once more, the merge content will be placed before the previous table, instead of replacing the table that is inside the mergefield.

It looks as if the mergefield closing object is placed on the first paragraph of the table when loading it inside wptools. When it should be placed after the table.

Is there anything i can do to fix this behavior.

Thanks in advance,

Leander

WpTools 5.36

#1 ♥ 0
3.7k Views 2 users read 4 min
support

Hi,

WPTools has a problem to load that file with an intact closing field object. It will work if there is one more empty par after the table or if you use WPT format.

Julian

#2 ♥ 0

I already tried adding an additional paragraph, and i'm sure this will work for the WPT format, but unfortunately we need to use the RTF Format.

I have been able to change the rtf reader so the closing field is placed after the table, but all content after the closing tag will then obtain (some of) the same attributes as the closing tag itself. Particulary making the text uneditable (protected).

#3 ♥ 0

I'm probably doing something wrong with adding 1 new paragraph, because i used this:

lvRtfDataCollection.SelectBody;lvRTFDataCollection.FirstPar.AppendNewPar(True); //added this linelvTable := TParagraph.CreateTable(lvRTFDataCollection.FirstPar)

This still failed for me, but i'm not certain that a paragraph was added after the table. Its more as if the table replaces the paragraph.

The following however did work:

lvRtfDataCollection.SelectBody;
lvRTFDataCollection.FirstPar.AppendNewPar(True).AppendNewPar(True); //added this line
lvTable := TParagraph.CreateTable(lvRTFDataCollection.FirstPar)

So you were correct.

It's a shame though that hiding this paragraph (paprHidden), will have the same effect for me as not creating a paragraph at all. And setting the lineheight with lvPar.Aset(WPAT_LineHeight, 1); doesn't seem to effect the paragraph at all.

So i'll be forced to show an empty paragraph, but that's still acceptable.

Many thanks.

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