> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Content controls

## `ContentControl`

Import from `@reductoai/docx/node`, `@reductoai/docx/officejs`.

### ContentControl properties

| Name | Type | Description |
| - | - | - |
| `isNullObject` | `boolean` | read-only |
| `appearance` | `ContentControlAppearance` | |
| `buildingBlockGalleryContentControl` | `{ contentControl: ContentControl; isNullObject: false }` | read-only |
| `cannotDelete` | `boolean` | |
| `cannotEdit` | `boolean` | |
| `checkboxContentControl` | `CheckboxContentControl` | read-only |
| `color` | `string` | |
| `comboBoxContentControl` | `ListContentControl` | read-only |
| `contentControls` | `ContentControlCollection` | read-only |
| `datePickerContentControl` | `DatePickerContentControl` | read-only |
| `dropDownListContentControl` | `ListContentControl` | read-only |
| `endnotes` | `HandleCollection<NoteItem>` | read-only |
| `fields` | `FieldCollection` | read-only |
| `font` | `Font` | read-only |
| `footnotes` | `HandleCollection<NoteItem>` | read-only |
| `groupContentControl` | `{ contentControl: ContentControl; isNullObject: false }` | read-only |
| `id` | `number` | read-only |
| `inlinePictures` | `HandleCollection<InlinePicture>` | read-only |
| `lists` | `HandleCollection<List>` | read-only |
| `paragraphs` | `ParagraphCollection<Paragraph>` | read-only |
| `parentBody` | `Body` | read-only |
| `parentContentControl` | `ContentControl` | read-only |
| `parentContentControlOrNullObject` | `ContentControl & { isNullObject: boolean }` | read-only |
| `parentTable` | `Table` | read-only |
| `parentTableCell` | `TableCell` | read-only |
| `parentTableCellOrNullObject` | `TableCell & { isNullObject: boolean }` | read-only |
| `parentTableOrNullObject` | `Table & { isNullObject: boolean }` | read-only |
| `pictureContentControl` | `{ contentControl: ContentControl; isNullObject: false }` | read-only |
| `placeholderText` | `string` | |
| `removeWhenEdited` | `boolean` | |
| `repeatingSectionContentControl` | `{ contentControl: ContentControl; isNullObject: false }` | read-only |
| `style` | `string \| undefined` | |
| `styleBuiltIn` | `string \| undefined` | |
| `subtype` | `ContentControlType` | read-only |
| `tables` | `TableCollection<Table>` | read-only A row-level control reads the table that holds its rows, as Word does. |
| `tag` | `string \| null` | |
| `text` | `string` | read-only Word reads a control that shows its placeholder as empty. |
| `title` | `string \| null` | |
| `type` | `ContentControlType` | read-only |
| `xmlMapping` | `XmlMapping` | read-only |

### `clear()`

```ts theme={null}
clear(): void
```

### `delete()`

```ts theme={null}
delete(keepContent: boolean): void
```

### `getComments()`

```ts theme={null}
getComments(): CommentCollection
```

### `getContentControls()`

```ts theme={null}
getContentControls(options?: ContentControlOptions): ContentControlCollection
```

### `getHtml()`

```ts theme={null}
getHtml(): ClientResult<string>
```

As Word: tables as `<table>` (merges as colspan/rowspan), `<h1>-<h6>` for headings,
list markers as text, b/i/u/s/sup/sub and links inline.

### `getOoxml()`

```ts theme={null}
getOoxml(): ClientResult<string>
```

### `getRange()`

```ts theme={null}
getRange(location?: RangeLocation): Range
```

### `getReviewedText()`

```ts theme={null}
getReviewedText(version?: "Original" | "Current"): ClientResult<string>
```

### `getTextRanges()`

```ts theme={null}
getTextRanges(endingMarks: string[], trimSpacing?: boolean): RangeCollection<Range>
```

### `getTrackedChanges()`

```ts theme={null}
getTrackedChanges(): TrackedChangeCollection
```

### `insertBreak()`

```ts theme={null}
insertBreak(
  type: "Page" | "Next" | "SectionNext" | "SectionContinuous" | "SectionEven" | "SectionOdd" | "Line",
  location: "Start" | "End" | "Before" | "After",
): void
```

### `insertContentControl()`

```ts theme={null}
insertContentControl(type?: ContentControlType): ContentControl
```

Nest a control around this one's content; the id is fresh for the story.

### `insertFileFromBase64()`

```ts theme={null}
insertFileFromBase64(
  base64File: DocxFile,
  insertLocation?: "Replace" | "Start" | "End",
): Promise<Range>
```

Insert a .docx's body at the edge (or in place of the content), with its images, links, styles,
numbering, notes and comments. Async here: unlike Word, the file is unpacked on this side.

### `insertOoxml()`

```ts theme={null}
insertOoxml(ooxml: string, insertLocation?: "Replace" | "Start" | "End"): Range
```

A WML fragment or `pkg:package` inside the control: at its content's edge or in its place.

### `insertParagraph()`

```ts theme={null}
insertParagraph(
  text: string,
  location?: "Start" | "End" | "Before" | "After",
): Paragraph
```

### `insertTable()`

```ts theme={null}
insertTable(
  rowCount: number,
  columnCount: number,
  location?: "Start" | "End" | "Before" | "After",
  values?: string[][],
): Table
```

### `insertText()`

```ts theme={null}
insertText(text: string, location?: "Replace" | "Start" | "End"): Range
```

### `search()`

```ts theme={null}
search(text: string, options?: SearchOptions): RangeCollection<Range>
```

### `set()`

```ts theme={null}
set(properties: ContentControlUpdateData, options?: UpdateOptions): void
```

### `split()`

```ts theme={null}
split(
  delimiters: string[],
  multiParagraphs?: boolean,
  trimDelimiters?: boolean,
  trimSpacing?: boolean,
): RangeCollection<Range>
```

Office.js ContentControl.split: the control's text cut after each delimiter.

**Not implemented.** These Office.js members throw: `onDataChanged`, `onDeleted`, `onEntered`, `onExited`, `onSelectionChanged`, `insertHtml`, `insertInlinePictureFromBase64`, `select`.
