Dixos
Dixos

Reputation: 93

Insert HTML in displayNewAppointmentForm Office.js

I've been working on a Office.js add-in that automatically generates some text depending on a few previously saved settings. This text is editable.

I'm using CKEDITOR v4.14 for the rich-text editor. However, when I click "Planlegg møte" (Plan meeting), the text itself is pasted into the displayNewAppointmentForm object as plain-text, HTML tags and all. No conversion is happening.

Upon closing the dialog box, I'm creating the new appointment by caling the following after closing the dialog and before completing the button click event:

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;

I also tried setting the body by calling Office.context.document.setSelectedDataAsync after initializing the new appointment form but it seems very little is happening on the Outlook client on PC.

Is it possible to insert a message as HTML or otherwise formatted (with newline "\n" for example) in the displayNewAppointmentForm body?

Upvotes: 0

Views: 268

Answers (1)

user7823505
user7823505

Reputation:

You are able to use special characters such as \n and \t, however HTML is not possible today. We track Outlook add-in feature requests on our user-voice page.

It looks like the feature you want has been requested by others already. Please upvote the existing request displayNewAppointmentForm. Feature requests on user-voice are considered when we go through our planning process.

Upvotes: 2

Related Questions