for example:
procedure TForm1.Button1Click(Sender: TObject);
var
Item:TWPRTFExtraDataItem;
begin
WPRichText1.RTFVariables.Strings['abc']:='a';
WPRichText1.RTFVariables.Strings['def']:='a';
Item:=WPRichText1.RTFVariables.Find('abc');
Item.Mode:=wpxData;
Item.LoadFromFile('e:\abc.txt');
WPRichText1.SaveToFile('e:\cs.wpt');
end;
then,Reopen Application ,Use the code:
procedure TForm1.Button2Click(Sender: TObject);
var
Item:TWPRTFExtraDataItem;
begin
WPRichText1.LoadFromFile('e:\cs.wpt');
Item:=WPRichText1.RTFVariables.Find('abc',wpxData);
if Item<>nil then
begin
Item.SaveToFile('e:\a.txt');
end;
end;
the item is nil,but the variable 'def' exists。