This is a migrated thread and some comments may be shown as answers.

Pasting email address from Outlook then exporting causes exception

3 Answers 80 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 13 Apr 2016, 12:01 PM

Hi,

I have noticed what appears to be a bug.

How to repeat:

1. Copy any email address from the body of an Outlook Email (Outlook 2013).

2. Paste the email address into the radrichtextbox.

3. Save the content via code below;

 Dim fp As New RtfFormatProvider
 Dim Result As String = fp.Export(rtb.Document) <<< exception occurs

Exception Details:

"The given key was not present in the dictionary."

Stack Trace:

at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Export.RtfDocumentExporter.ExportSpanProperties(SpanProperties spanProps, ExportContext context, RtfWriter writer)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Export.RtfDocumentExporter.ExportSpanProperties(Span span)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Export.RtfDocumentExporter.ExportSpan(Span span)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Export.RtfDocumentExporter.ExportInline(Inline inline)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Export.RtfDocumentExporter.ExportFieldFragment(DocumentFragment fragment)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Export.RtfDocumentExporter.ExportCodeBasedFieldRangeStart(FieldRangeStart fieldStart)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Export.RtfDocumentExporter.ExportFieldRangeStart(FieldRangeStart rangeStart)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Export.RtfDocumentExporter.ExportInline(Inline inline)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Export.RtfDocumentExporter.ExportParagraph(Paragraph paragraph)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Export.RtfDocumentExporter.ExportBlock(Block block)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Export.RtfDocumentExporter.ExportSection(Section section)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Export.RtfDocumentExporter.ExportDocument()
   at Telerik.Windows.Documents.FormatProviders.Rtf.Export.RtfDocumentExporter.Export()
   at Telerik.Windows.Documents.FormatProviders.Rtf.RtfFormatProvider.Export(RadDocument document, Stream output)
   at Telerik.Windows.Documents.FormatProviders.Rtf.RtfFormatProvider.Export(RadDocument document)

 

If any more information is required please let me know and I will provide what I can.

 

Kind Regards,

 

Shaun

3 Answers, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 14 Apr 2016, 10:07 AM
Hi Shaun,

This is known issue. You can follow its item on our public portal to get notification for any status changes here:
Document with hyperlink pasted from Outlook throws exception on export to RTF

In the meantime, you can try the workaround from the item, namely to manually register style  corresponding to the Outlook hyperlink style:
var style = new StyleDefinition("test", StyleType.Character);
style.SpanProperties.ForeColor = Color.FromArgb(100, 200, 25, 104);
this.radRichTextBox.Document.StyleRepository.Add(style);

Regards,
Boby
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Shaun
Top achievements
Rank 1
answered on 14 Apr 2016, 10:10 AM
Thanks for the update Boby I will follow the issue.
0
Shaun
Top achievements
Rank 1
answered on 14 Apr 2016, 10:10 AM
Thanks for the update Boby I will follow the issue on the portal.
Tags
RichTextBox
Asked by
Shaun
Top achievements
Rank 1
Answers by
Boby
Telerik team
Shaun
Top achievements
Rank 1
Share this question
or