Page 1 of 1
Find/Replace removes text style
Posted: Thu Jun 19, 2014 12:48 am
by sefrojones
I'm finding that when I do a find and replace, that all of the text styles (e.g. bold, italic, etc) are removed from the field when the target word is replaced. I'm using LC 6.6.2 on Windows 764 bit. Is this a bug, or is there a way to turn this behavior off?
Thanks,
Sefro
Re: Find/Replace removes text style
Posted: Thu Jun 19, 2014 2:39 am
by PBH
Sefro,
There is a note about this behaviour in the dictionary, so it's not seen as a bug.
Here's the noteā¦
Important! You can use the replace command on a field, but doing so removes any formatting (fonts, styles, colors, and sizes) in the field. To work around this limitation, use the field's htmlText property as the source for replacement instead of using the field itself as the source:
get the htmlText of field "Stuff"
replace "old" with "new" in it
set the htmlText of field "Stuff" to it
HTH
Paul
Re: Find/Replace removes text style
Posted: Thu Jun 19, 2014 5:08 am
by sefrojones
I can't believe I didn't look in the dictionary, since I was using the built in Find and replace I had hoped this wasn't the case. Thanks for the info.