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
changeCapitalization Changes the capitalization of all selected characters depending on the 'capitalizationParameter' parameter.
changeDirection Changes the writing direction of all selected paragraphs.
decreaseIndent Decreases the left indent of all paragraphs contained in the current text selection.
getAutoBaseline Gets values specifying automatic sub- or superscripted text.
getBaseline Gets the baseline alignment, in twips, of the selected text.
getBold Gets the bold attribute of the selected text.
getCapitals Gets values specifying wheather lowercase letters are displayed with capital letters.
getCharacterScaling Gets or sets the style's character scaling, in percent of the average character width.
getCharacterSpacing Gets the style's character spacing value, in twips.
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.
growFont Increases the font size of each font contained in the current text selection.If no text is selected, this method increases the font size at the text input position.
increaseIndent Increases the left indent of all paragraphs contained in the current text selection.
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.
removeFormatting Resets all character based formatting attributes of the selected text to its default values.
removeInlineStyles Removes all character based styles of the selected text so that all attributes are reset to the attributes of the paragraph style.
save Saves the current selection in a certain format and sends the result back asynchronously by calling a given callback function.
setAutoBaseline Sets values specifying automatic sub- or superscripted text.
setBaseline Sets the baseline alignment, in twips, of the selected text.
setBold Sets the bold attribute of the selected text.
setBounds Obsolete.
setCapitals Sets values specifying wheather lowercase letters are displayed with capital letters.
setCharacterScaling Sets or sets the style's character scaling, in percent of the average character width.
setCharacterSpacing Sets the style's character spacing value, in twips.
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.
shrinkFont Decreases the font size of each font contained in the current text selection.

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: