TX Text Control .NET Server

TextFrame Object

Object|Introduced in 28.0

Description

The TextFrame object represents a rectangle that can be filled with text by an end-user and can be edited like the main text.

Syntax

TextFrame

Examples

The following example demonstrates TextFrame in a practical document-editing workflow. The TextFrame object represents a rectangle that can be filled with text by an end-user and can be edited like the main text.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectTextFrame(textFrame) {
    textFrame.getID(
        function(result) {
            console.log("get id result:", result);
        },
        onTxError
    );
}

Members

Properties

PropertyDescription
applicationFieldsGets a collection of all Microsoft Word fields that have been created or imported from a Microsoft Word or RTF document. (Inherited from FormattedText.)
commentsGets a collection of all comments in this text part. (Inherited from FormattedText.)
documentLinksGets a collection of all links which point to targets in the same document. (Inherited from FormattedText.)
documentTargetsGets a collection of all document targets. (Inherited from FormattedText.)
editableRegionsGets a collection of all editable regions. (Inherited from FormattedText.)
formFieldsGets a collection of all form fields in the text part. (Inherited from FormattedText.)
framesGets a collection of all frames in the document. (Inherited from FormattedText.)
hypertextLinksGets a collection of all hypertext links. (Inherited from FormattedText.)
linesGets a collection of all text lines. (Inherited from FormattedText.)
misspelledWordsGets a collection of all misspelled words. (Inherited from FormattedText.)
paragraphsGets a collection of all paragraphs. (Inherited from FormattedText.)
selectionGets the current selection. (Inherited from FormattedText.)
subTextPartsGets the current subtextparts. (Inherited from FormattedText.)
tablesGets a collection of all tables. (Inherited from FormattedText.)
tablesOfContentsGets the current tables of contents. (Inherited from FormattedText.)
textCharsGets a collection of all text characters. (Inherited from FormattedText.)
textFieldsGets a collection of all standard text fields. (Inherited from FormattedText.)
textPartTypeGets the Text part type. Possible values are "mainText", "headerFooter" and "textFrame". (Inherited from FormattedText.)
trackedChangesGets a collection of all tracked changes. (Inherited from FormattedText.)

Methods

MethodDescription
activateActivates the text frame. The text frame receives the input focus. A text frame can only be activated, if the text part that contains the text frame has the input focus.
changeZOrderChanges the frame's z-order.
findFinds a text string. The search starts at the specified position. (Inherited from FormattedText.)
getAlignmentGets the frame's horizontal alignment when it is anchored to a paragraph.
getBackColorGets the background color of the text frame.
getBorderColorGets the border color of the text frame.
getBorderStyleGets the style of a text frame's border line.
getBorderWidthGets the width, in twips, of a text frame's border line.
getBoundsGets the frame's bounding rectangle relative to the upper left corner of the document.
getDescriptiveTextGets the descriptive text for the text frame. An empty string indicates that the text frame has no such text.
getIDGets an identifier for the frame. A value of zero indicates that the image, text frame, chart, barcode or drawing has no identifier.
getInsertionModeGets a value determining whether the frame is treated as a single character or the document's text either flows around or overwrites the frame. If the document's text flows around or overwrites the frame, this property also determines whether the image, text frame, chart, barcode or drawing is moved with the text or fixed positioned on a page.
getInternalMarginsSets the distances, in twips, between the text frame's border line and the text.
getLocationGets, in twips, the frame's current location. If the image, text frame, chart, barcode or drawing is anchored to a paragraph, the location is relative to the paragraph. Otherwise, it is relative to the document. If the frame has a horizontal alignment or if it is inserted inline, this property returns zero. This property cannot be set for images, text frames, charts, barcodes or drawings which are inserted inline.
getMoveableGets whether a frame can be moved in the document at run time with the built-in mouse interface.
getNameGets the name for the frame. An empty string indicates that the frame has no name.
getSizeGets the frame's size in twips.
getSizeableGets whether the frame can be resized at run time with the built-in mouse interface.
getTextDistancesGets the distances, in twips, between the frame and the document's text.
getTextFieldsByTypeReturns an array of static text field information objects. (Inherited from FormattedText.)
getTextPositionGets the frame's character position in the document's text (one-based).
getTransparencyGets the text frame's transparency. Zero means opaque and 1.0 means completely transparent.
setAlignmentSets the frame's horizontal alignment when it is anchored to a paragraph.
setBackColorSets the background color for the text frame.
setBorderColorSets the border color for the text frame.
setBorderStyleSets the style of a text frame's border line.
setBorderWidthSets the width, in twips, of a text frame's border line. To alter the distance between the border line and the text, use the InternalMargins property. If this property is set to zero, the text frame has no border line.
setDescriptiveTextSets a descriptive text for the text frame. An empty string or null can be used to delete a previously set text.
setIDSets an identifier for the frame. It must be a one-based value. A value of zero indicates that the image, text frame, chart, barcode or drawing has no identifier. Zero can also be used to delete a previously set identifier.
setInsertionModeSets a value determining whether the frame is treated as a single character or the document's text either flows around or overwrites the frame. If the document's text flows around or overwrites the frame, this property also determines whether the image, text frame, chart, barcode or drawing is moved with the text or fixed positioned on a page.
setInternalMarginsSets the distances, in twips, between the text frame's border line and the text. If a value is set to -1, it is not changed.
setLocationSets, in twips, the frame's current location. If the image, text frame, chart, barcode or drawing is anchored to a paragraph, the location is relative to the paragraph. Otherwise, it is relative to the document. If the frame has a horizontal alignment or if it is inserted inline, this property returns zero. This property cannot be set for images, text frames, charts, barcodes or drawings which are inserted inline.
setMoveableSets whether a frame can be moved in the document at run time with the built-in mouse interface.
setNameSets a name for the frame. An empty string indicates that the frame has no name. An empty string can also be used to delete a previously set name.
setSizeSets the frame's size in twips. For images this property is read only.
setSizeableSets whether the frame can be resized at run time with the built-in mouse interface.
setTextDistancesSets the distances, in twips, between the frame and the document's text. If a value is set to -1, it is not changed.
setTransparencySets the text frame's transparency. It must be a value between 0.0 and 1.0. Zero means opaque and 1.0 means completely transparent.