trichview.com

trichview.support




Changing Style of RVData item


Return to index


Author

Message

Jim Maguire

Posted: 05/18/2005 1:48:44


I have templates stored in a DB and use a simple mail merge like your

example {name} is replaced during the merge.  I want to programmatically

change the fields like {name} to protected, bold fields like your merge

example.  I've got it working using your FillFields routine, but instead of

replacing with the field value, I replace {name} with NAME.


The problem I have is that I can't seem to get the style to apply, neither

the bold nor the protection takes effect.  I think the problem is that I've

found the field using the RVData property, but change the style using the

TRichViewEdit, here's the code at the end of FillFields:


      if Changed then

      begin

        rve.CurTextStyleNo := 1;  //this is a protected style

        rve.RVData.SetItemTextA(i, FieldName);

        rve.RVData.SetItemTag(i, Integer(StrNew(PChar((FieldName)))));

      end;


What's the best way to change the style of an item found in RVData?  Do I

have to select the field in order to apply the style change?


Thanks, your control is fabulous!





Powered by ABC Amber Outlook Express Converter