Hi Julian,
doing this, "sometimes" an AV occured:
procedure SetField_In(slFeld, slWert : String);
var tp : TWPTextObj;
FromStart : Boolean;
begin
FromStart := TRUE;
repeat
tp := WF.WPRTF.FieldLocate(slFeld, '', FromStart, [wplocGlobalSearch,wplocDontMoveCursor]);
if tp<>nil then
tp.Embeddedtext := slWert;
FromStart := FALSE;
until tp = nil;
end;
begin
par := WPRTF.ActiveParagraph;
nPos := WPRTF.CPPosInPar;
...
SetField(.....)
SetField(.....)
SetField(.....)
SetField(.....)
...
WPRTF.ActiveParagraph := par;
WPRTF.CPPosInPar := nPos;
end;
Hope this callstack can help
Thanks
Delphi 7 WPTools 5.07.2007 V5.0 Release 24.3a
Patrick
#1
♥ 0