I have to scrub pasted fragments from web sources to remove any hyperlinks in those fragments but keep the text associated with the link if any. I have tried the following code which gets the proper hyperlink elements, but this is not removing the hyperlink info. Please let me know the proper method of finding all hyperlinks in the pasted document content and removing those links. Thanks.
var richTextBox = new RadRichTextBox();
richTextBox.InsertFragment(document.Selection.CopySelectedDocumentElements());
richTextBox.Document.Selection.SelectAll();
var boxes = richTextBox.Document.Selection.GetSelectedBoxes().Where(b => b.AssociatedInline.FieldStart != null && b.AssociatedInline.FieldStart.GetType() == typeof(HyperlinkRangeStart));
foreach (var box in boxes)
{
richTextBox.Document.CaretPosition.MoveToInline(box.AssociatedInline);
richTextBox.RemoveHyperlink();
}