Skip to main content

Format Rendering Overview

APIDescriptionExample
Range.DisplayFormatProperty that returns the format rendering overview object for the specified rangelet range = instance.Application.ActiveSheet.Range("A1");

let displayFormat = range.DisplayFormat;
DisplayFormat.BordersProperty that returns the border management object for the specified rangelet range = instance.Application.ActiveSheet.Range("A1");

let borders = range.DisplayFormat.Borders;
DisplayFormat.FontProperty that returns the font management object for the specified rangelet range = instance.Application.ActiveSheet.Range("A1");

let font = range.DisplayFormat.Font;
DisplayFormat.HorizontalAlignmentProperty that returns the horizontal alignment state of text for the specified rangelet range = instance.Application.ActiveSheet.Range("A1");

console.log(range.DisplayFormat.HorizontalAlignment);
DisplayFormat.InteriorProperty that returns the background management object for the specified rangelet range = instance.Application.ActiveSheet.Range("A1");

let interior = range.DisplayFormat.Interior;
DisplayFormat.MergeCellsProperty that returns whether the specified range is mergedlet range = instance.Application.ActiveSheet.Range("A1");

console.log(range.DisplayFormat.MergeCells);
DisplayFormat.NumberFormatProperty that returns the display format of the specified rangelet range = instance.Application.ActiveSheet.Range("A1");

console.log(range.DisplayFormat.NumberFormat);
DisplayFormat.ShrinkToFitProperty that returns whether the specified range automatically adjusts column width to fit datalet range = instance.Application.ActiveSheet.Range("A1");

console.log(range.DisplayFormat.ShrinkToFit);
DisplayFormat.VerticalAlignmentProperty that returns the vertical alignment state of text for the specified rangelet range = instance.Application.ActiveSheet.Range("A1");

console.log(range.DisplayFormat.VerticalAlignment);
DisplayFormat.WrapTextProperty that returns the text wrapping state of the specified rangelet range = instance.Application.ActiveSheet.Range("A1");

console.log(range.WrapText);
DisplayFormat.CharactersFunction that returns the string management object for the specified rangelet range = instance.Application.ActiveSheet.Range("A1");
range.Value2 = "Example";

let ExampleCharacters = range.DisplayFormat.Characters();
let amCharacters = range.DisplayFormat.Characters(3, 2);
Characters.CaptionProperty that returns or changes the string managed by the string management objectlet 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.CountProperty that returns the length of the string managed by the string management objectlet 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.FontProperty that returns the font management object for the string managed by the string management objectlet 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.TextProperty that returns or changes the string managed by the string management objectlet 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.DeleteFunction that removes the string managed by the string management objectlet range = instance.Application.ActiveSheet.Range("A1"); range.Value2 = "Example";
let amCharacters = range.DisplayFormat.Characters(3, 2);

amCharacters.Delete(); // Exple
Characters.InsertFunction that replaces the string managed by the string management object with another stringlet range = instance.Application.ActiveSheet.Range("A1");
range.Value2 = "Example";
let amCharacters = range.DisplayFormat.Characters(3, 2);

amCharacters.Insert("TEST"); // ExTESTple

Format Management , Font Style , Cell Background Color and Border , Text Alignment and Line Breaks , Conditional Formatting , Custom Formatting