3

Mac 上的 Office.context.mailbox.item.body.getAsync() 缺少某些样式,例如项目符号。

细节:

  • 使用 CoercionType.Html。
  • 仅在 Outlook for Mac 客户端上发生,在 OWA 上不发生。
  • macOS High Sierra 10.13.2 上的 Outlook for Mac 版本 16.13。
  • 要重现,请使用客户端 UI 在消息正文中插入项目符号:

• Testing bullets

  • 使用强制类型 HTML 调用 getAsync 并期望以下内容:

<p class=MsoListParagraph style='text-indent:0in'>Testing bullets</p>

  • 使用上面的 HTML 调用 setAsync 并期望项目符号消失

注意:我了解文档表明:

Body.getAsync 和 Body.setAsync 方法不是幂等的。

但是项目符号是从 Outlook UI 本身插入的,我希望 API 能够完全支持它。

4

1 回答 1

0

您应该作为 HTML 无序列表元素插入,而不是样式段落:

Word.run(function(context) {
  var body = context.document.body;
  body.insertHtml("<ul><li>Testing Bullet 1</li><li>Testing Bullet 2</li></ul>", Word.InsertLocation.start);
  return context.sync();
});
于 2018-05-21T15:14:02.180 回答