The requested page is not available for the requested platform. You are viewing the content for Default platform.

SubDocument Class

Defines a sub-document in a document.

Declaration

export class SubDocument

Properties

bookmarks Property

Provide access to the sub-document's collection of bookmarks.

Declaration

readonly bookmarks: BookmarkCollection<Bookmark>

Property Value

Type Description
BookmarkCollection<Bookmark>

A collection of bookmarks.

id Property

Gets the sub-document identifier.

Declaration

readonly id: number

Property Value

Type Description
number

The sub-document identifier.

length Property

Gets the character length of the sub-document.

Declaration

readonly length: number

Property Value

Type Description
number

The number of character positions in the sub-document.

paragraphs Property

Provide access to sub-document paragraphs.

Declaration

readonly paragraphs: ParagraphCollection

Property Value

Type Description
ParagraphCollection

A collection of sub-document paragraphs.

tables Property

Provide access to sub-document tables.

Declaration

readonly tables: TableCollection

Property Value

Type Description
TableCollection

A collection of sub-document tables.

type Property

Gets the sub-document type.

Declaration

readonly type: SubDocumentType

Property Value

Type Description
SubDocumentType

The sub-document type.

Methods

deleteText(interval) Method

Deletes the specified text interval.

Declaration

deleteText(interval: IInterval): void

Parameters

Name Type Description
interval IInterval

The text interval to delete.

Remarks


richEdit.document.subDocuments.main.deleteText({start: 10, length: 15});

getCharacterProperties(interval) Method

Returns character properties of the specified text interval.

Declaration

getCharacterProperties(interval: IInterval): CharacterProperties

Parameters

Name Type Description
interval IInterval

An object that contains information about a text interval.

Returns

Type Description
CharacterProperties

An object that contains the character properties.

getParagraphProperties(interval) Method

Returns paragraph properties of the specified text interval.

Declaration

getParagraphProperties(interval: IInterval): ParagraphProperties

Parameters

Name Type Description
interval IInterval

An object that contains information about a text interval.

Returns

Type Description
ParagraphProperties

An object that contains the paragraph properties.

getText Method

Return the document's textual representation contained in the specified interval.

Declaration

getText(interval?: Interval): string

Optional Parameters

Name Type Default Description
interval Interval null

A document interval.

Returns

Type Description
string

The text contained in the specified interval.

insertLineBreak(position) Method

Inserts the line break at the specified position in the sub-document.

Declaration

insertLineBreak(position: number): Interval

Parameters

Name Type Description
position number

A position in the sub-document.

Returns

Type Description
Interval

The interval that contains the inserted line break.

insertParagraph(position) Method

Inserts a new paragraph into the paragraphs collection at a specified position.

Declaration

insertParagraph(position: number): Paragraph

Parameters

Name Type Description
position number

A position to insert a new paragraph.

Returns

Type Description
Paragraph

The newly inserted paragraph.

insertPicture(position, base64) Method

Inserts a picture to the sub-document.

Declaration

insertPicture(position: number, base64: string, size?: Size, callback?: (interval: Interval) => void): void

Parameters

Name Type Description
position number

A position in the document.

base64 string

The picture in string representation that is encoded with base-64 digits.

Optional Parameters

Name Type Default Description
size Size null

The image size.

callback (interval: Interval) => void null

A function that is called after the picture is inserted.

insertSectionBreak(position, type) Method

Inserts the section break at the specified position in the document.

Declaration

insertSectionBreak(position: number, type: SectionBreakType): void

Parameters

Name Type Description
position number

A position in the document.

type SectionBreakType

The type of a section break.

insertText(position, text) Method

Inserts the specified text at the specified position.

Declaration

insertText(position: number, text: string): Interval

Parameters

Name Type Description
position number

A position to insert the text.

text string

The text to insert.

Returns

Type Description
Interval

The interval that contains the inserted text.

setCharacterProperties(interval, characterProperties) Method

Applies character properties to a text interval.

Declaration

setCharacterProperties(interval: IInterval, characterProperties: CharacterProperties): void

Parameters

Name Type Description
interval IInterval

An object that contains information about a text interval.

characterProperties CharacterProperties

An object that contains the applied character properties.

setParagraphProperties(interval, paragraphProperties) Method

Applies paragraph properties to a text interval.

Declaration

setParagraphProperties(interval: IInterval, paragraphProperties: ParagraphProperties): void

Parameters

Name Type Description
interval IInterval

An object that contains information about a text interval.

paragraphProperties ParagraphProperties

An object that contains the applied paragraph properties.