* Add the passed tags to the value where the text is selected * Notice how the line feeds are stripped out, they were causeing problems lcNewString = tcTag + substr(strtran(.Value, chr(10)), .SelStart + 1, .SelLength) + tcCloseTag .Value = STUFF(strtran(.Value, chr(10)), .SelStart + 1, .SelLength, lcNewString) .SelLength = len(lcNewString)I've written HTML editors in VFP before, and this is just a snippet of code from a button like you are describing.