Hi
Thanks to the link to the full javascript list I was able to achieve what I wanted. I am afraid the example jeff gave did not work because ExtractRangeHTML and InsertHTML only affect the selected text. As we have nothing selected just a point where its clicked ExtractRangeHTML returned nothing and InsertHTML just wacked the html into the middle of the stuff I wanted replacing. However I did find a function that helped.....
var node = editor.GetPointNode();
editor.SelectControl(node);
editor.InsertHTML(html);
By using the selectcontrol I was able to highlight the control I wanted to replace then InsertHTML worked as we wanted.