ITextPara interface

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

When to implement

Applications typically do not implement the ITextPara interface. Microsoft text solutions, such as rich edit controls implement ITextPara as part of their TOM implementation.

When to use

Applications can retrieve an ITextPara pointer for a text range by calling the GetPara method.

Members

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

Methods

The ITextPara interface has these methods.

MethodDescription
AddTab

Adds a tab at the displacement tbPos, with type tbAlign, and leader style, tbLeader.

CanChange

Determines whether the paragraph formatting can be changed.

ClearAllTabs

Clears all tabs, reverting to equally spaced tabs with the default tab spacing.

DeleteTab

Deletes a tab at a specified displacement.

GetAlignment

Retrieves the current paragraph alignment value.

GetDuplicate

Creates a duplicate of the specified paragraph format object. The duplicate property is the default property of an ITextPara object.

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.

GetHyphenation

Determines whether automatic hyphenation is enabled for the range.

GetKeepTogether

Determines whether page breaks are allowed within paragraphs.

GetKeepWithNext

Determines whether page breaks are allowed between paragraphs in the range.

GetLeftIndent

Retrieves the distance used to indent all lines except the first line of a paragraph. The distance is relative to the left margin.

GetLineSpacing

Retrieves the line-spacing value for the text range.

GetLineSpacingRule

Retrieves the line-spacing rule for the text range.

GetListAlignment

Retrieves the kind of alignment to use for bulleted and numbered lists.

GetListLevelIndex

Retrieves the list level index used with paragraphs.

GetListStart

Retrieves the starting value or code of a list numbering sequence.

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.

GetListType

Retrieves the kind of numbering to use with paragraphs.

GetNoLineNumber

Determines whether paragraph numbering is enabled.

GetPageBreakBefore

Determines whether each paragraph in the range must begin on a new page.

GetRightIndent

Retrieves the size of the right margin indent of a paragraph.

GetSpaceAfter

Retrieves the amount of vertical space below a paragraph.

GetSpaceBefore

Retrieves the amount of vertical space above a paragraph.

GetStyle

Retrieves the style handle to the paragraphs in the specified range.

GetTab

Retrieves tab parameters (displacement, alignment, and leader style) for a specified tab.

GetTabCount

Retrieves the tab count.

GetWidowControl

Retrieves the widow and orphan control state for the paragraphs in a range.

IsEqual

Determines if the current range has the same properties as a specified range.

Reset

Resets the paragraph formatting to a choice of default values.

SetAlignment

Sets the paragraph alignment.

SetDuplicate

Sets the formatting for an existing paragraph by copying a given format.

SetHyphenation

Controls hyphenation for the paragraphs in the range.

SetIndents

Sets the first-line indent, the left indent, and the right indent for a paragraph.

SetKeepTogether

Controls whether page breaks are allowed within a paragraph in a range.

SetKeepWithNext

Controls whether page breaks are allowed between the paragraphs in a range.

SetLineSpacing

Sets the paragraph line-spacing rule and the line spacing for a paragraph.

SetListAlignment

Sets the alignment of bulleted or numbered text used for paragraphs.

SetListLevelIndex

Sets the list level index used for paragraphs.

SetListStart

Sets the starting number or Unicode value for a numbered list.

SetListTab

Sets the list tab setting, which is the distance between the first indent and the start of the text on the first line.

SetListType

Sets the type of list to be used for paragraphs.

SetNoLineNumber

Determines whether to suppress line numbering of paragraphs in a range.

SetPageBreakBefore

Controls whether there is a page break before each paragraph in a range.

SetRightIndent

Sets the right margin of paragraph.

SetSpaceAfter

Sets the amount of space that follows a paragraph.

SetSpaceBefore

Sets the amount of space preceding a paragraph.

SetStyle

Sets the paragraph style for the paragraphs in a range.

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 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Tom.h

DLL

Msftedit.dll

See also

Conceptual
Text Object Model
Using The Text Object Model

 

 

Community Additions

ADD
Show:
© 2014 Microsoft