首页 > 解决方案 > 在 displayNewAppointmentForm Office.js 中插入 HTML

问题描述

我一直在开发一个 Office.js 加载项,它会根据之前保存的一些设置自动生成一些文本。此文本是可编辑的。

我将 CKEDITOR v4.14 用于富文本编辑器。但是,当我单击“Planlegg møte”(计划会议)时,文本本身会以纯文本、HTML 标记等形式粘贴到 displayNewAppointmentForm 对象中。没有发生转换。

关闭对话框后,我通过在关闭对话框后和完成按钮单击事件之前调用以下命令来创建新约会:

dialog.close();
dialog = null;
setTimeout(() => {
  Office.context.mailbox.displayNewAppointmentForm({
     location: 'https://' + settings.data.domain + '.easymeeting.net/' + settings.data.number,
     subject: 'Easymeeting videomøte',
     requiredAttendees: [],
     optionalAttendees: [],
     resources: [Office.context.mailbox.userProfile.emailAddress],
     body: settings.data.message,
  });
}, 500);
btnEvent.completed();
btnEvent = null;

在初始化新的约会表单后,我还尝试通过调用 Office.context.document.setSelectedDataAsync 来设置正文,但在 PC 上的 Outlook 客户端上似乎很少发生。

是否可以在 displayNewAppointmentForm 正文中插入 HTML 或其他格式的消息(例如使用换行符“\n”)?

标签: outlookoffice-jsoutlook-web-addins

解决方案


您可以使用特殊字符,例如\n\t,但目前还不能使用 HTML。我们在 <a href="https://officespdev.uservoice.com/forums/224641-general/category/131778-outlook-add-ins" rel="nofollow noreferrer">user- 上跟踪 Outlook 加载项功能请求语音页面。

看起来您想要的功能已经被其他人请求了。请支持现有的请求displayNewAppointmentForm。当我们进行规划过程时,会考虑用户语音的功能请求。


推荐阅读