Office js 正在大纲内添加\n个字符。段落。项目[0]。插入RichTextAssiling(';在';之前,代码);

Office js 正在大纲内添加\n个字符。段落。项目[0]。插入RichTextAssiling(';在';之前,代码);,office-js,onenote,onenote-api,Office Js,Onenote,Onenote Api,我正在尝试通过添加OneNote(Web)段落中的\n换行符文本 outline.parations.items[0]。InsertRichTextAssiling('Before',text) 问题是这些换行符在一个音符中不可见。但在页面刷新后,它们仍然可见。我错过什么了吗 显示行为的Gif。 \n不支持字符 你可以这样做 var row1Text = outline.paragraphs.items[0].insertRichTextAsSibling('Before', 'row 1');

我正在尝试通过添加OneNote(Web)段落中的\n换行符文本

outline.parations.items[0]。InsertRichTextAssiling('Before',text)

问题是这些换行符在一个音符中不可见。但在页面刷新后,它们仍然可见。我错过什么了吗

显示行为的Gif。

\n不支持字符 你可以这样做

var row1Text = outline.paragraphs.items[0].insertRichTextAsSibling('Before', 'row 1');
var row2Text = row1Text.paragraph.insertRichTextAsSibling('After', 'row 2');
var row3Text = row2Text.paragraph.insertRichTextAsSibling('After', 'row 3');
var row4Text = row3Text.paragraph.insertRichTextAsSibling('After', 'row 4');

你要找的是

大纲.段落.项目[0].插入分类('Before',“row1
row2
row3
row4
);
有了这个功能,你就可以创建列表、表格、带有黑体等特殊字体的文本

outline.paragraphs.items[0].insertHtmlAsSibling('Before', "row1<br>row2<br>row3<br>row4<br>);