TX Text Control ActiveX

TextFrameInsert Method

Method

This method inserts a new text frame anchored to a paragraph. The text flows around the text frame.

Introduced: 12.0.

Syntax

TXTextControl.TextFrameInsert TextPos, Alignment, PosX, PosY, Width, Height, TextFlow, DistanceL, DistanceT, DistanceR, DistanceB

Parameters

ParameterDescription
TextPosSpecifies a text position in the paragraph where to insert the text frame. If TextPos is -1, the text frame is anchored to the paragraph at the current input position.
AlignmentSpecifies the text frame's horizontal alignment. It can be one of the following values:
PosXSpecifies the text frame's horizontal position in twips relative to the left border of the paragraph. This value is used if the Alignment parameter has been set to 0.
PosYSpecifies the text frame's vertical position in twips relative to the top border of the paragraph.
WidthSpecifies the width of the text frame in twips. If this parameter is set to zero, a built-in mouse interface is started which enables the end-user to define the size of the text frame through a rectangle, drawn with the mouse.
HeightSpecifies the height of the text frame in twips. If this parameter is set to zero, a built-in mouse interface is started which enables the end-user to define the size of the text frame through a rectangle, drawn with the mouse.
TextFlowSpecifies how text flows around the text frame. It can be one of the following values:
DistanceL, DistanceT, DistanceR, DistanceBSpecifies distances, in twips, between the text frame and the document's text.

Alignment

ValueDescription
0The horizontal position is given through the PosX parameter.
1The text frame is left aligned relative to the paragraph to which it is anchored.
2The text frame is right aligned relative to the paragraph to which it is anchored.
3The text frame is centered relative to the paragraph to which it is anchored.

TextFlow

ValueDescription
2The text stops at the top and continues at the bottom of the text frame.
3The text flows around the text frame. Empty areas at the left and right side are filled.

Return Value

The method returns the text frame's identifier, if a new text frame could be inserted. Otherwise, it returns zero. The text frame's identifier can also be obtained with the ObjectCurrent property.

Data Types

NameData type
TextPosLong
AlignmentInteger
PosXLong
PosYLong
WidthInteger
HeightInteger
TextFlowInteger
DistanceLInteger
DistanceTInteger
DistanceRInteger
DistanceBInteger
Return valueInteger

See Also