OverviewExamples
RichText.SetSelectionFormat ( |
boolean ApplyToWord = false ) |
Sets the character formatting of the current selection in a richtext object.
(string) The name of the richtext object.
(table) A table containing the format settings you want to modify in the richtext object, indexed by the following items.
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 to set the selected characters as all capital letters and false to not. This value applies only to versions earlier than Rich Edit 3.0. |
|||||||||||||||||||||||||||||||||||||||||||||
AutoBackColor |
boolean |
True to use the background color of the object's background color for selected text (ignore BackColor), false if BackColor should be used. |
|||||||||||||||||||||||||||||||||||||||||||||
AutoColor |
boolean |
True to use the text color of the objects text color for selected text (ignore TextColor), false if TextColor should be used. |
|||||||||||||||||||||||||||||||||||||||||||||
Bold |
boolean |
True if the selected text should be bolded, false if it should not. |
|||||||||||||||||||||||||||||||||||||||||||||
Disabled |
boolean |
True if characters should be displayed as disabled, false if they should not. |
|||||||||||||||||||||||||||||||||||||||||||||
Emboss |
boolean |
True if the characters should be embossed, false if they should not. (This item has no effect on displayed text in the object.) |
|||||||||||||||||||||||||||||||||||||||||||||
Hidden |
boolean |
True if the characters should be displayed, false if they should not. This item is only supported for Rich Edit 3.0 and later. |
|||||||||||||||||||||||||||||||||||||||||||||
Imprint |
boolean |
True if characters should be displayed as imprinted characters, false if they should not. (This item has no effect on displayed text in the object.) |
|||||||||||||||||||||||||||||||||||||||||||||
Italic |
boolean |
True if characters should be italic, false if they should not. |
|||||||||||||||||||||||||||||||||||||||||||||
Link |
boolean |
True if the selection should contains links, false if it should not. |
|||||||||||||||||||||||||||||||||||||||||||||
Outline |
boolean |
True if characters should be displayed as outlined characters, false if they should not. (This value has no effect on displayed text in the object.) |
|||||||||||||||||||||||||||||||||||||||||||||
Protected |
boolean |
True if the characters should be protected, false if they should not. |
|||||||||||||||||||||||||||||||||||||||||||||
Revised |
boolean |
True if characters should be marked as revised, false if they should not. |
|||||||||||||||||||||||||||||||||||||||||||||
Shadow |
boolean |
True if the characters should be displayed as shadowed characters, false if they should not. (This value has no effect on displayed text in the object.) |
|||||||||||||||||||||||||||||||||||||||||||||
SmallCaps |
boolean |
True if characters should be in small capital letters, false if they should not. (This value has no effect on displayed text in the object.) |
|||||||||||||||||||||||||||||||||||||||||||||
StrikeOut |
boolean |
True if characters should be struck out, false if they should not. |
|||||||||||||||||||||||||||||||||||||||||||||
SubScript |
boolean |
True if the characters should be subscript, false if they should not. |
|||||||||||||||||||||||||||||||||||||||||||||
SuperScript |
boolean |
True if the characters should be superscript, false if they should not. |
|||||||||||||||||||||||||||||||||||||||||||||
Underline |
boolean |
True if the characters should be underlined, false if they should not. |
|||||||||||||||||||||||||||||||||||||||||||||
Height |
number |
The height of the characters to set in twips. |
|||||||||||||||||||||||||||||||||||||||||||||
YOffset |
number |
The character offset from the baseline to set, 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 to set. This item is ignored if AutoColor is set to true. |
|||||||||||||||||||||||||||||||||||||||||||||
CharacterSet |
number |
The character set of the text to use:
|
|||||||||||||||||||||||||||||||||||||||||||||
PitchAndFamily |
number |
The font family and pitch to use. See MSDN: CHARFORMAT2 Structure for more information. |
|||||||||||||||||||||||||||||||||||||||||||||
FaceName |
string |
The name of the font to use in the selected text. |
|||||||||||||||||||||||||||||||||||||||||||||
Weight |
number |
The weight of the font to use (how 'dark' the text is):
|
|||||||||||||||||||||||||||||||||||||||||||||
Spacing |
number |
The horizontal space between letters to use, 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 to set. This value is ignored if AutoBackColor is set to true. |
|||||||||||||||||||||||||||||||||||||||||||||
LCID |
number |
The locale identifier of the selected text to use. (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 to use 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 to use. (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. |
(boolean) Whether to apply the formatting to any words the selection covers (or the insertion point is in), or to apply the formatting only to the selected characters (or to new characters entered at the insertion point if nothing is selected).
VALUE |
DESCRIPTION |
true |
Apply formatting to any words the selection covers. |
false |
Only apply formatting to selected characters. (Default) |
Nothing. You can use Application.GetLastError to determine whether this action failed, and why.
See also: Related Actions