Format Rendering Overview
| API | Description | Example |
|---|---|---|
| Range.DisplayFormat | Property that returns the format rendering overview object for the specified range | let range = instance.Application.ActiveSheet.Range("A1"); let displayFormat = range.DisplayFormat; |
| DisplayFormat.Borders | Property that returns the border management object for the specified range | let range = instance.Application.ActiveSheet.Range("A1"); let borders = range.DisplayFormat.Borders; |
| DisplayFormat.Font | Property that returns the font management object for the specified range | let range = instance.Application.ActiveSheet.Range("A1"); let font = range.DisplayFormat.Font; |
| DisplayFormat.HorizontalAlignment | Property that returns the horizontal alignment state of text for the specified range | let range = instance.Application.ActiveSheet.Range("A1"); console.log(range.DisplayFormat.HorizontalAlignment); |
| DisplayFormat.Interior | Property that returns the background management object for the specified range | let range = instance.Application.ActiveSheet.Range("A1"); let interior = range.DisplayFormat.Interior; |
| DisplayFormat.MergeCells | Property that returns whether the specified range is merged | let range = instance.Application.ActiveSheet.Range("A1"); console.log(range.DisplayFormat.MergeCells); |
| DisplayFormat.NumberFormat | Property that returns the display format of the specified range | let range = instance.Application.ActiveSheet.Range("A1"); console.log(range.DisplayFormat.NumberFormat); |
| DisplayFormat.ShrinkToFit | Property that returns whether the specified range automatically adjusts column width to fit data | let range = instance.Application.ActiveSheet.Range("A1"); console.log(range.DisplayFormat.ShrinkToFit); |
| DisplayFormat.VerticalAlignment | Property that returns the vertical alignment state of text for the specified range | let range = instance.Application.ActiveSheet.Range("A1"); console.log(range.DisplayFormat.VerticalAlignment); |
| DisplayFormat.WrapText | Property that returns the text wrapping state of the specified range | let range = instance.Application.ActiveSheet.Range("A1"); console.log(range.WrapText); |
| DisplayFormat.Characters | Function that returns the string management object for the specified range | let range = instance.Application.ActiveSheet.Range("A1"); range.Value2 = "Example"; let ExampleCharacters = range.DisplayFormat.Characters(); let amCharacters = range.DisplayFormat.Characters(3, 2); |
| Characters.Caption | Property that returns or changes the string managed by the string management object | let range = instance.Application.ActiveSheet.Range("A1"); range.Value2 = "Example"; let ExampleCharacters = range.DisplayFormat.Characters(); console.log(ExampleCharacters.Caption); // Example string is printed to the console. let amCharacters = range.DisplayFormat.Characters(3, 2); console.log(amCharacters.Caption); // AM string is printed to the console. |
| Characters.Count | Property that returns the length of the string managed by the string management object | let range = instance.Application.ActiveSheet.Range("A1"); range.Value2 = "Example"; let ExampleCharacters = range.DisplayFormat.Characters(); console.log(ExampleCharacters.Count); // 7 is printed to the console. let amCharacters = range.DisplayFormat.Characters(3, 2); console.log(amCharacters.Count); // 2 is printed to the console. |
| Characters.Font | Property that returns the font management object for the string managed by the string management object | let range = instance.Application.ActiveSheet.Range("A1"); range.Value2 = "Example"; let amCharacters = range.DisplayFormat.Characters(3, 2); let font = amCharacters.Font; // Font applied only to the am string |
| Characters.Text | Property that returns or changes the string managed by the string management object | let range = instance.Application.ActiveSheet.Range("A1"); range.Value2 = "Example"; let ExampleCharacters = range.DisplayFormat.Characters(); console.log(ExampleCharacters.Text); // Example string is output to console let amCharacters = range.DisplayFormat.Characters(3, 2); console.log(amCharacters.Text); // am string is output to console |
| Characters.Delete | Function that removes the string managed by the string management object | let range = instance.Application.ActiveSheet.Range("A1"); range.Value2 = "Example"; let amCharacters = range.DisplayFormat.Characters(3, 2); amCharacters.Delete(); // Exple |
| Characters.Insert | Function that replaces the string managed by the string management object with another string | let range = instance.Application.ActiveSheet.Range("A1"); range.Value2 = "Example"; let amCharacters = range.DisplayFormat.Characters(3, 2); amCharacters.Insert("TEST"); // ExTESTple |
Related Features
Format Management , Font Style , Cell Background Color and Border , Text Alignment and Line Breaks , Conditional Formatting , Custom Formatting