I need to Display something like this:
This is
ALL in one
cell
HELP - How do I do that?
The best reference I have is:
Code:
Microsoft.Office.Tools.Excel.NamedRange charactersRange;
private void FormatCharacters()
{
charactersRange = this.Controls.AddNamedRange(
this.Range["A1", "A1"], "charactersRange");
this.charactersRange.Value2 = "Smith";
this.charactersRange.Characters[1, 1].Font.Bold = true;
this.charactersRange.Characters[1, 1].Font.Size = 14;
}
From:
http://msdn.microsoft.com/en-us/libr...rs(VS.80).aspx
But I can't seem to get the namespace/Reference correct....
I can change any cell to any color/font/size/alignment/ect.. even add hyperlink correctly but can't seem to get two fonts or color type in same cell.....
It's gotta lie with "NamedRange" / "Character" reference..
.just can't get it to compile or work.... PLZ help.....
Sample Working Code from my project:
Code:
((Excel.Range)oSheet.Columns["A:M", Type.Missing]).Font.Size = 9;
oSheet.get_Range("L1", "L1").Interior.ColorIndex = 15;
oSheet.get_Range("A1", "L1").EntireColumn.Borders.LineStyle = Excel.XlLineStyle.xlContinuous;
oSheet.get_Range("A:A", "L:L").VerticalAlignment = Excel.XlVAlign.xlVAlignTop;
oSheet.get_Range("A:A", "L:L").HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft;
oSheet.Hyperlinks.Add(oSheet.get_Range("A" + tempRowCount, Type.Missing), tempHyperLink, Type.Missing, "Reference to:" + listView3.Items[row].SubItems[col].Text.ToString(), listView3.Items[row].SubItems[col].Text.ToString());