# Javascript: FrameBase.setInsertionMode Method

> Sets 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.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: FrameBase.setInsertionMode Method
- **552 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/framebase/setinsertionmode-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/framebase/setinsertionmode-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/framebase/setinsertionmode-method/llms-full.txt

---

### Description

Sets 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.

### Syntax

```javascript
<void> FrameBase.setInsertionMode(<FrameInsertionMode> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| value | The new property value. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `FrameBase.setInsertionMode` in a practical document-editing workflow. It sets 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.

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

function configureInsertionMode(frameBase) {
    frameBase.setInsertionMode(
        TXTextControl.FrameInsertionMode.AsCharacter,
        function() {
            console.log("set insertion mode completed.");
        },
        onTxError
    );
}
```

### Remarks

The values of the FrameInsertionMode enumeration can be combined. The following combinations are possible: DisplaceCompleteLines and MoveWithText, DisplaceCompleteLines and FixedOnPage, DisplaceText and MoveWithText, DisplaceText and FixedOnPage, AboveTheText and MoveWithText, AboveTheText and FixedOnPage, BelowTheText and MoveWithText, BelowTheText and FixedOnPage, AsCharacter. For all other combinations an exception is thrown.

---

## Nearby

- **Previous:** [Javascript: FrameBase.setID Method](https://docs.textcontrol.com/ds-server/reference/javascript/framebase/setid-method/llms-full.txt)
- **Next:** [Javascript: FrameBase.setLocation Method](https://docs.textcontrol.com/ds-server/reference/javascript/framebase/setlocation-method/llms-full.txt)
