ITextPara interface

Text Object Model (TOM) rich text-range attributes are accessed through a pair of dual interfaces, ITextFont and ITextPara.

Inheritance

The ITextPara interface inherits from the IDispatch interface. ITextPara also has these types of members:

Methods

The ITextPara interface has these methods.

Method Description
ITextPara::AddTab Adds a tab at the displacement tbPos, with type tbAlign, and leader style, tbLeader.
ITextPara::CanChange Determines whether the paragraph formatting can be changed.
ITextPara::ClearAllTabs Clears all tabs, reverting to equally spaced tabs with the default tab spacing.
ITextPara::DeleteTab Deletes a tab at a specified displacement.
ITextPara::GetAlignment Retrieves the current paragraph alignment value.
ITextPara::GetDuplicate Creates a duplicate of the specified paragraph format object. The duplicate property is the default property of an ITextPara object.
ITextPara::GetFirstLineIndent Retrieves the amount used to indent the first line of a paragraph relative to the left indent. The left indent is the indent for all lines of the paragraph except the first line.
ITextPara::GetHyphenation Determines whether automatic hyphenation is enabled for the range.
ITextPara::GetKeepTogether Determines whether page breaks are allowed within paragraphs.
ITextPara::GetKeepWithNext Determines whether page breaks are allowed between paragraphs in the range.
ITextPara::GetLeftIndent Retrieves the distance used to indent all lines except the first line of a paragraph. The distance is relative to the left margin.
ITextPara::GetLineSpacing Retrieves the line-spacing value for the text range.
ITextPara::GetLineSpacingRule Retrieves the line-spacing rule for the text range.
ITextPara::GetListAlignment Retrieves the kind of alignment to use for bulleted and numbered lists.
ITextPara::GetListLevelIndex Retrieves the list level index used with paragraphs.
ITextPara::GetListStart Retrieves the starting value or code of a list numbering sequence.
ITextPara::GetListTab Retrieves the list tab setting, which is the distance between the first-line indent and the text on the first line. The numbered or bulleted text is left-justified, centered, or right-justified at the first-line indent value.
ITextPara::GetListType Retrieves the kind of numbering to use with paragraphs.
ITextPara::GetNoLineNumber Determines whether paragraph numbering is enabled.
ITextPara::GetPageBreakBefore Determines whether each paragraph in the range must begin on a new page.
ITextPara::GetRightIndent Retrieves the size of the right margin indent of a paragraph.
ITextPara::GetSpaceAfter Retrieves the amount of vertical space below a paragraph.
ITextPara::GetSpaceBefore Retrieves the amount of vertical space above a paragraph.
ITextPara::GetStyle Retrieves the style handle to the paragraphs in the specified range.
ITextPara::GetTab Retrieves tab parameters (displacement, alignment, and leader style) for a specified tab.
ITextPara::GetTabCount Retrieves the tab count.
ITextPara::GetWidowControl Retrieves the widow and orphan control state for the paragraphs in a range.
ITextPara::IsEqual Determines if the current range has the same properties as a specified range.
ITextPara::Reset Resets the paragraph formatting to a choice of default values.
ITextPara::SetAlignment Sets the paragraph alignment.
ITextPara::SetDuplicate Sets the formatting for an existing paragraph by copying a given format.
ITextPara::SetHyphenation Controls hyphenation for the paragraphs in the range.
ITextPara::SetIndents Sets the first-line indent, the left indent, and the right indent for a paragraph.
ITextPara::SetKeepTogether Controls whether page breaks are allowed within a paragraph in a range.
ITextPara::SetKeepWithNext Controls whether page breaks are allowed between the paragraphs in a range.
ITextPara::SetLineSpacing Sets the paragraph line-spacing rule and the line spacing for a paragraph.
ITextPara::SetListAlignment Sets the alignment of bulleted or numbered text used for paragraphs.
ITextPara::SetListLevelIndex Sets the list level index used for paragraphs.
ITextPara::SetListStart Sets the starting number or Unicode value for a numbered list.
ITextPara::SetListTab Sets the list tab setting, which is the distance between the first indent and the start of the text on the first line.
ITextPara::SetListType Sets the type of list to be used for paragraphs.
ITextPara::SetNoLineNumber Determines whether to suppress line numbering of paragraphs in a range.
ITextPara::SetPageBreakBefore Controls whether there is a page break before each paragraph in a range.
ITextPara::SetRightIndent Sets the right margin of paragraph.
ITextPara::SetSpaceAfter Sets the amount of space that follows a paragraph.
ITextPara::SetSpaceBefore Sets the amount of space preceding a paragraph.
ITextPara::SetStyle Sets the paragraph style for the paragraphs in a range.
ITextPara::SetWidowControl Controls the suppression of widows and orphans.

Remarks

The ITextFont and ITextPara interfaces encapsulate the functionality of the Microsoft Word Format Font and Paragraph dialog boxes, respectively. Both interfaces include a duplicate (Value) property that can return a duplicate of the attributes in a range object or transfer a set of attributes to a range. As such, they act like programmable format painters. For example, you could transfer all attributes from range r1 to range r2 except for making r2 bold and the font size 12 points by using the following subroutine.

Sub AttributeCopy(r1 As ITextRange, r2 As ITextRange)
    Dim tf As ITextFont
    tf = r1.Font                ' Value is the default property    
    tf.Bold = tomTrue           ' You can make some modifications
    tf.Size = 12
    tf.Animation = tomSparkleText
    r2.Font = tf                ' Apply font attributes all at once
End Sub

See SetFont for a similar example written in C++.

The ITextPara interface encapsulates the Word Paragraph dialog box. All measurements are given in floating-point points. The rich edit control is able to accept and return all ITextPara properties intact (that is, without modification), both through TOM and through its Rich Text Format (RTF) converters. However, the following properties have no effect on what the control displays:

  • DoNotHyphen
  • KeepTogether
  • KeepWithNext
  • LineSpacing
  • LineSpacingRule
  • NoLineNumber
  • PageBreakBefore
  • Tab alignments
  • Tab styles (other than tomAlignLeft and tomSpaces)
  • Style WidowControl

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header tom.h

See also

Conceptual

IDispatch

Text Object Model

Using The Text Object Model