Skip to content

Instantly share code, notes, and snippets.

Created June 15, 2020 19:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
This is the code from a Task Pane Add-in that sends a message to a Content Add-in via a CustomXMLPart
const ns = "";
const xml = "<message xmlns=''>" +
"<sentby>[who]</sentby>" +
"<info>[data]</info>" +
const from_tp = "TASKPANE ADD-IN";
function sendMessage() { {
var data = xml.replace("[who]", from_tp).replace("[data]", "This message is coming from the taskpane.");
const customXmlPart = context.workbook.customXmlParts.add(data);
return context.sync().then();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment