How to manually edit mailmerge fieldname and fieldtext?

  • Hi,

    i am using WPtools version 4.11a with BCB and i need to manually change Mailmerge fieldname and fieldtext.

    Code
    {\field{\*\fldinst{MERGEFIELD CUSTOMER.NAME }}<\plain\f0\fs22\cf0 [Name]}}}where "CUSTOMER.NAME" is the fieldname and "Name" is fieldtext

    For example, i can select a mailmerge field with mouse from RtfTextEdit and then edit this field in order to change its name and text.

    I can change fieldname by using:

    Code
    PTAttr pa;  Word n;  String s,s1;  AnsiString field,fieldname;  pa = RtfTextEdit->CPAttr();  n = pa->Tag;  if(n != 0)  {    s = RtfTextEdit->Memo->InsertPointList->Strings[n];    s1 = s;    if( InputQuery("Insertpoint", "Fieldname", s1) && (s1 != s) )      RtfTextEdit->Memo->InsertPointList->Strings[n] = s1;        }

    also, if i use the following code i can evaluate fieldname and fieldtext content:

    Code
    AnsiString field,fieldname;
    RtfTextEdit->ReadFieldAtCP(field,fieldname);

    but i can't change the fieldname !!!
    Is there any way (available function) to do this by editing the selected field?