GetSelectionParagraphStyle()

Syntax:

textObject.GetSelectionParagraphStyle()

Return:

A new object with some of the following properties. A property is only present within the object if it is consistently used across the whole selection. For example, if the selection includes more than one paragraph and the justification is different for each paragraph, the justification property will not appear in the new object. To ensure this does not happen, you should ensure you only select one paragraph at a time with this function. The object properties are:

justification – this is a string showing the selections justification. The string will contain one of the following key words: left, right, centre, full, density or aspect.

linespacing – this is a string showing the method of spacing for the paragraph. The string will begin with one of the following key words: x, = or At Least.

    1. (i) If it begins with x (e.g. x1, x2) it is a multiple. For example x2 means the linespacing is double-spaced, x3 triple-spaced, and so on.

    2. (ii) If the string begins with = (e.g. =12pt, =20pt) it is an exact height. This means, the spacing is a specific size and the line is always exactly this high.

    3. (iii) If the string is At Least the line height is a specific size. This means, ‘at least this high’, therefore, larger text will force the line to be higher.

spacingbefore – this is a number indicating the point size of the spacing between the last paragraph and the current paragraph.

spacingafter – this is a number indicating the point size of the spacing after the current paragraph and the next paragraph.

leftindent – this is a number indicating the number of pixels spaces from the left edge of the Text object and the first letter on a line in the paragraph.

rightindent – this is a number indicating the number of pixel spaces from the right edge of the Text object and the last letter on a line in the paragraph.

firstlineindent – this is a number indicating the number of pixel spaces from the left edge of the Text object and the first letter on the first line of text in a paragraph.

hangingindent – this is a number indicating the number of pixel spaces have been set for a hanging indent in a Text object.

bullet – a string indicating the type of bullet used for the paragraph. The string will contain one of the following key words: no bullet, character or graphical.

Remarks:

This function will return a new object containing information about the paragraph’s style settings, such as, if the paragraph is left or right justified, uses single spacing or hanging indents, and so on. This function will only work if you currently have text in a Text object selected using the SetSelection function. If more than one paragraph is selected and they have different settings the new object will not contain that property.

This function can be used to determine the style of one Text object in your publication that you can then apply to a different Text object using the SetSelectionParagraphStyle function. Alternatively, the SetSelectionParagraphStyle function can be used to change one or more of the paragraph styles of the Text object specified with this function to a new style.

image\Script_Button.jpgExamples

 

see also:GetSelectionStyle and SetSelectionStyle