This is the code from a Task Pane Add-in that sends a message to a Content Add-in via a CustomXMLPart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ns = "http://pfe.microsoft.com/excelpoc/1.0"; | |
const xml = "<message xmlns='http://pfe.microsoft.com/excelpoc/1.0'>" + | |
"<sentby>[who]</sentby>" + | |
"<info>[data]</info>" + | |
"</message>"; | |
const from_tp = "TASKPANE ADD-IN"; | |
function sendMessage() { | |
Excel.run(function(context) { | |
var data = xml.replace("[who]", from_tp).replace("[data]", "This message is coming from the taskpane."); | |
const customXmlPart = context.workbook.customXmlParts.add(data); | |
customXmlPart.load(); | |
return context.sync().then(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment