跳到主要内容

ApiRichContent

表示富内容的类。

方法​

下表列出了可用的方法。

方法返回值描述
AddElementboolean使用其在富文本内容中的位置添加富文本段落。
GetClassType"richContent"返回 ApiRichContent 类的类型。
GetContentApiRichParagraph[]返回当前富文本内容对象中的富文本段落数组。
GetCurrentParagraphApiRichParagraph | null | undefined返回光标所在的当前段落。
GetCurrentRunApiRichRun | null | undefined返回光标所在的当前文本域。
GetElementApiRichParagraph | null | undefined根据其在内容中的位置返回富文本段落。
GetElementsCountnumber返回当前文档中的元素数量。
GetTextstring返回当前文档内容对象的内部文本。
Pushboolean将富文本段落推送到富文本内容。
RemoveAllElementsboolean从当前富文本内容中移除所有元素。
RemoveElementboolean使用指定的位置移除元素。