public string ConvertRichTextBoxContentsToString(System.Windows.Controls.RichTextBox rtb)
{
try
{
TextRange textRange = new TextRange(rtb.Document.ContentStart,
rtb.Document.ContentEnd);
return textRange.Text.ToString().Trim();
}
catch (Exception ex)
{
//
}
return null;
}