EXCEL Read RichText in C#, VB.NET

  • Demo
  • C# source
  • VB.Net source
 

The sample demonstrates how to read rich text from spreadsheet.

ReadRichText.gif

		private void btnRun_Click(object sender, System.EventArgs e)
		{
			Workbook workbook = new Workbook();
			workbook.LoadFromFile(@"..\..\..\..\..\..\Data\RichTextSample.xls");
			Worksheet sheet = workbook.Worksheets[0];

			richTextBox1.Rtf = sheet.Range["A1"].RichText.RtfText;
		}

		Private Sub btnRun_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRun.Click
			Dim workbook As Workbook = New Workbook()
			workbook.LoadFromFile("..\..\..\..\..\..\Data\RichTextSample.xls")
			Dim sheet As Worksheet = workbook.Worksheets(0)

			richTextBox1.Rtf = sheet.Range("A1").RichText.RtfText
		End Sub