Hi Julian,
Since releasing a version of our product that now has calculation support, customers are complaining that they are getting syntax errors in their formulas when saving (we do a Recalc when saving changes), however, they are not even using calculation formulas!
Turns out that linked images in some cases are causing the issue. Seeing how these are text objects, I had to add code to your RecalcText function in WPRTEDefs unit to confirm that the text object is actually named "CALC" before trying to actually do the calculation (we use the name property in image text objects):
if fields and par.HasObjects(false, [wpobjTextObject]) then
begin
for i := 0 to par.CharCount - 1 do
begin
obj := par.ObjectRef[i];
if (obj <> nil) and (obj.ObjType = wpobjTextObject) and
(obj.Source <> '') and SameText(obj.Name, 'CALC') then
begin
The added check for 'CALC' above solves the problem my customers have been having.
Hope this is a reasonable fix since your documentation states that formula text objects must be named "CALC".
Eric