WPCubed Product Support

Deleting Mail merge fields

Hi
Is there an easy way to remove a mailmerge field from a template when the user deletes any part of the visible part of the field?

I have found that the field still exists and is picked up in the

rtEdit.FieldGetList(fieldList,true,'');

method which means that some of our processing is still being performed on these fields.

#1 ♥ 0
4.2k Views 2 users read 1 min
support

Hi,

the "visible part" is not actually a part of the field, it is te text located within the objects. The objects can be visible or hidden. If the user deletes one of the object the other is also deleted.

I don't see a way to delete a field when the user deletes a part of a field. But it would be possible to trap the delete key and check for the current field - DeleteFieldAtCP

Julian

#2 ♥ 0

Great - works fine

procedure TPopupFrmLtgnEditor.rtEditKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
var
   textObj : TWPTextObj;
begin
   if key in [VK_BACK,VK_DELETE] then
   begin
      textObj := rtEdit.fieldatCP;
      if assigned(textObj) then
         rtEdit.DeleteFieldAtCP;
   end;
end;
#3 ♥ 0
This category is archived. No new posts are possible.