OverviewExamples
table RichText.GetSelectionFormat ( |
Returns a table describing the character format of the current selection in a richtext object.
(string) The name of the richtext object.
(boolean) Whether the table should only contain attributes that are consistent throughout the selection. (If true, any mixed attributes will be nil. If false, the table will describe all attributes of the first parts of the selection.)
VALUE |
DESCRIPTION |
true |
Only contain attributes consistent throughout selection (mixed attributes will be nil). (Default) |
false |
Describe all attributes of the first parts of the selection. |
(table) A table describing the character format of the current selection in a richtext object, indexed by the following values. If there is no selection or an error occurs, nil is returned. You can use Application.GetLastError to determine whether this action failed, and why.
Note: Some of the following table items are included only for compatibility with Microsoft Text Object Model (TOM) interfaces; the rich edit control stores the value but does not use it to display text. The functionality of some of the items may also depend on the version of the rich edit control available on the system.
KEY |
TYPE |
DESCRIPTION |
|||||||||||||||||||||||||||||||||||||||||||||
AllCaps |
boolean |
True if the selected characters are all capital letters and false if they are not. This value applies only to versions earlier than Rich Edit 3.0. |
|||||||||||||||||||||||||||||||||||||||||||||
AutoBackColor |
boolean |
True if the background color is the object's background color for selected text (BackColor is ignored), false if BackColor is used. |
|||||||||||||||||||||||||||||||||||||||||||||
AutoColor |
boolean |
True if the text color is the objects text color for selected text (TextColor is ignored), false if TextColor is used. |
|||||||||||||||||||||||||||||||||||||||||||||
Bold |
boolean |
True if the selected text is bolded, false if it is not. |
|||||||||||||||||||||||||||||||||||||||||||||
Disabled |
boolean |
True if characters are displayed as disabled, false if they are not. |
|||||||||||||||||||||||||||||||||||||||||||||
Emboss |
boolean |
True if the characters are embossed, false if they are not. (This item has no effect on displayed text in the object.) |
|||||||||||||||||||||||||||||||||||||||||||||
Hidden |
boolean |
True if the characters are displayed, false if they are not. This item is only supported for Rich Edit 3.0 and later. |
|||||||||||||||||||||||||||||||||||||||||||||
Imprint |
boolean |
True if characters are displayed as imprinted characters, false if they are not. (This item has no effect on displayed text in the object.) |
|||||||||||||||||||||||||||||||||||||||||||||
Italic |
boolean |
True if characters are italic, false if they are not. |
|||||||||||||||||||||||||||||||||||||||||||||
Link |
boolean |
True if the selection contains links, false if it does not. |
|||||||||||||||||||||||||||||||||||||||||||||
Outline |
boolean |
True if characters are displayed as outlined characters, false if they are not. (This value has no effect on displayed text in the object.) |
|||||||||||||||||||||||||||||||||||||||||||||
Protected |
boolean |
True if the characters are protected, false if they are not. |
|||||||||||||||||||||||||||||||||||||||||||||
Revised |
boolean |
True if characters are marked as revised, false if they are not. |
|||||||||||||||||||||||||||||||||||||||||||||
Shadow |
boolean |
True if the characters are displayed as shadowed characters, false if they are not. (This value has no effect on displayed text in the object.) |
|||||||||||||||||||||||||||||||||||||||||||||
SmallCaps |
boolean |
True if characters are in small capital letters, false if they are not. (This value has no effect on displayed text in the object.) |
|||||||||||||||||||||||||||||||||||||||||||||
StrikeOut |
boolean |
True if characters are struck out, false if they are not. |
|||||||||||||||||||||||||||||||||||||||||||||
SubScript |
boolean |
True if the characters are subscript, false if they are not. |
|||||||||||||||||||||||||||||||||||||||||||||
SuperScript |
boolean |
True if the characters are superscript, false if they are not. |
|||||||||||||||||||||||||||||||||||||||||||||
Underline |
boolean |
True if the characters are underlined, false if they are not. |
|||||||||||||||||||||||||||||||||||||||||||||
Height |
number |
The height of the characters in twips. |
|||||||||||||||||||||||||||||||||||||||||||||
YOffset |
number |
The character offset from the baseline, in twips. If this value is positive, the character is a superscript; if the value is negative, the character is a subscript. |
|||||||||||||||||||||||||||||||||||||||||||||
TextColor |
number |
The text color. This item is ignored if AutoColor is set to true. |
|||||||||||||||||||||||||||||||||||||||||||||
CharacterSet |
number |
The character set of the text:
|
|||||||||||||||||||||||||||||||||||||||||||||
PitchAndFamily |
number |
The font family and pitch. See MSDN: CHARFORMAT2 Structure for more information. |
|||||||||||||||||||||||||||||||||||||||||||||
FaceName |
string |
The name of the font used in the selected text. |
|||||||||||||||||||||||||||||||||||||||||||||
Weight |
number |
The weight of the font (how 'dark' the text is):
|
|||||||||||||||||||||||||||||||||||||||||||||
Spacing |
number |
The horizontal space between letters, in twips. (This value has no effect on displayed text in the object. It is included for compatibility with Microsoft WindowsText Object Model (TOM) interfaces.) |
|||||||||||||||||||||||||||||||||||||||||||||
BackColor |
number |
The background color. This value is ignored if AutoBackColor is set to true. |
|||||||||||||||||||||||||||||||||||||||||||||
LCID |
number |
The locale identifier of the selected text. (This value has no effect on displayed text in the object.) See MSDN: CHARFORMAT2 Structure for more information. |
|||||||||||||||||||||||||||||||||||||||||||||
Kerning |
number |
The value of the font size, above which to kern the character (Height). (This value has no effect on displayed text in the object. It is included for compatibility with Microsoft WindowsText Object Model (TOM) interfaces.) |
|||||||||||||||||||||||||||||||||||||||||||||
Style |
number |
The character style handle. (This value has no effect on displayed text in the object. It is included for compatibility with Microsoft WindowsText Object Model (TOM) interfaces.) |
|||||||||||||||||||||||||||||||||||||||||||||
UnderlineType |
number |
The underline type specified by one of the following values:
CFU_UNDERLINEDOUBLE (3) - Double-underlined text. The object displays the text with a solid underline.
|
|||||||||||||||||||||||||||||||||||||||||||||
Animation |
number |
The text animation type. (This value has no effect on displayed text in the object. It is included for compatibility with TOM interfaces.) |
|||||||||||||||||||||||||||||||||||||||||||||
RevAuthor |
number |
An index that identifies the author making a revision. The rich edit control uses different text colors for each different author index. |
When adding an action with the script editor, you can use this field to specify a variable that the return value will be stored in.
See also: Related Actions