Describes and handles the attributes of a text selection. Each of the properties of this class returns the property's default value if the selection does not contain a common value.

Syntax

Selection

Introduced: X14.

Enumerations

Enumeration Description
Attribute Determines a certain selection attribute.

Methods

Method Description
getBaseline Gets the baseline alignment, in twips, of the selected text.
getBold Gets the bold attribute of the selected text.
getCulture Gets the culture as a languagecode2-country / regioncode2 string value.
getFontName Gets the font name of the selected text.
getFontSize Gets the font's size, in points, of the selected text.
getForeColor Gets the color used to display the selected text.
getFormattingStyle Gets the formatting style of the selected text.
getItalic Gets the italic attribute of the selected text.
getLength Gets the number of selected characters.
getStart Gets the starting point of selected text.
getStrikeout Gets the strikeout attribute of the selected text.
getText Gets the currently selected text.
getTextBackColor Gets the background color of the selected text.
getUnderline Gets the underlining styles of the selected text.
isCommonListFormatValueSelected Informs about whether an attribute from the ListFormat.Attribute enumeration has the same value for the complete selection.
isCommonPageBorderValueSelected Informs about whether an attribute from the PageBorder.Attribute enumeration has the same value for the complete selection.
isCommonPageMarginsValueSelected Informs about whether an attribute from the PageMargins.Attribute enumeration has the same value for the complete selection.
isCommonPageSizeValueSelected Informs about whether an attribute from the PageSize.Attribute enumeration has the same value for the complete selection.
isCommonPargraphFormatValueSelected Informs about whether an attribute from the ParagraphFormat.Attribute enumeration has the same value for the complete selection.
isCommonSectionFormatValueSelected Informs about whether an attribute from the SectionFormat.Attribute enumeration has the same value for the complete selection.
isCommonSelectionValueSelected Informs about whether an attribute from the Selection.Attribute enumeration has the same value for the complete selection.
load Loads text in a certain format into the current selection.
save Saves the current selection in a certain format and sends the result back asynchronously by calling a given callback function.
setBaseline Sets the baseline alignment, in twips, of the selected text.
setBold Sets the bold attribute of the selected text.
setBounds Deprecated.
setCulture Sets the culture as a languagecode2-country / regioncode2 string value.
setFontName Sets the font's name of the selected text.
setFontSize Sets the font's size, in points, of the selected text.
setForeColor Sets the selection's foreground color.
setFormattingStyle Sets the formatting style of the selected text.
setItalic Sets the italic attribute of the selected text.
setLength Sets the number of selected characters.
setStart Sets the starting point of selected text.
setStrikeout Sets the strikeout attribute of the selected text.
setText Sets the currently selected text.
setTextBackColor Sets the selection's background color.
setUnderline Sets the underlining styles for the selected text.

Properties

Property Description
listFormat Gets a bulleted or numbered list and / or its formatting attributes for the selected text.
paragraphFormat Gets the formatting attributes of the selected paragraphs.
sectionFormat Gets page settings such as margins, size and orientation for the selected text.

Further Reading

Learn more about the Javascript: Selection Object in the Text Control Blog: