RichText.GetParagraphFormat

table RichText.GetParagraphFormat ( 

string  ObjectName,

boolean OnlyConsistentAttributes = true )

Description

Returns a table describing the paragraph format of the current selection in a richtext object.

Parameters

ObjectName

(string) The name of the richtext object.

OnlyConsistentAttributes

(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 selected paragraph.)

VALUE

DESCRIPTION

true

Only contain attributes consistent throughout selection (mixed attributes will be nil). (Default)

false

Describe all attributes of the first selected paragraph.

Returns

(table) A table describing the paragraph 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: The functionality of some of the items may be depend on the version of the rich edit control available on the user's system.

KEY

TYPE

DESCRIPTION

Bulleted

boolean

True if the text selection is bulleted, false if it is not.

StartIndent

number

The left indent of the first line in twips. (and all subsequent lines if Offset is 0).

RightIndent

number

The right indent of the text, relative to the right margin, in twips.

Offset

number

The indentation of the second and subsequent lines, relative to the indentation of the first line, in twips.

Alignment

number

The paragraph alignment:
PFA_LEFT (1) - Paragraphs are aligned with the left margin.
PFA_RIGHT (2) - Paragraphs are aligned with the right margin.
PFA_CENTER (3) - Paragraphs are centered.
PFA_JUSTIFY (4) - Paragraphs are justified (Rich Edit 2.0). This value is included for compatibility with TOM interfaces; rich edit controls earlier than Rich Edit 3.0 display the text aligned with the left margin.

Tabs

table

A numerically indexed table of the tab positions.

SpaceBefore

number

The size of the spacing above the paragraph, in twips.

SpaceAfter

number

The size of the spacing below the paragraph, in twips.

LineSpacing

number

The spacing between lines based on the LineSpacingRule defined below.

LineSpacingRule

number

Type of line spacing based on one of the following values:
0
- Single spacing. The LineSpacing item is ignored.

1 - One-and-a-half spacing. The LineSpacing item is ignored.
2
- Double spacing. The LineSpacing item is ignored.
3
- The LineSpacing item specifies the spacing from one line to the next, in twips. However, if LineSpacing specifies a value that is less than single spacing, the control displays single-spaced text.
4
- The LineSpacing item specifies the spacing from one line to the next, in twips. The control uses the exact spacing specified, even if LineSpacing specifies a value that is less than single spacing.
5
- The value of LineSpacing / 20 is the spacing, in lines, from one line to the next. Thus, setting LineSpacing to 20 produces single-spaced text, 40 is double spaced, 60 is triple spaced, and so on.

BorderSpace

number

The space between the border and the paragraph text, in twips. This item is included for compatibility with Word; the rich edit control stores the values but does not use them to display text.

BorderWidth

number

The border width, in twips.

Borders

number

This item is only included for compatibility, and may not have any visible effect. For a description of this option, see MSDN: PARAFORMAT2 Structure.
 

ResultVariable

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