Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have html files data which are with .htm extension...i want to open that file in rich text box in WPF..how can i do it..my code is below...but it gives error that
'HTML Format' data format not supported.<br />
Parameter name: dataFormat

richTextBox_LessonView.Document = new FlowDocument();
             TextRange documentTextRange = new TextRange(
                 richTextBox_LessonView.Document.ContentStart, richTextBox_LessonView.Document.ContentEnd);

             using (FileStream fs = File.Open("softskill.htm", FileMode.Open))

                 documentTextRange.Load(fs, System.Windows.DataFormats.Rtf);
Posted
Updated 17-Jun-11 23:40pm
v2

1 solution

 
Share this answer
 
Comments
vishal_h 18-Jun-11 6:01am    
thanks but i am using VS2008 and that application is in vs2010 so some method are not working...
Monjurul Habib 18-Jun-11 6:07am    
google and you will find those for vs2008. :)
vishal_h 18-Jun-11 6:11am    
Sir i refer this http://www.codeproject.com/KB/WPF/WPFRichTextEditor.aspx link..download and working with this..
but i have two GB data which is in .htm extension and not opening in that rich text box..
could you please help me..i try at my best but as i am fresher i am not getting...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900