PowerPoint
A family of Microsoft presentation graphics products that offer tools for creating presentations and adding graphic effects like multimedia objects and special effects with text.
247 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have implemented this code to get document Id using, but it is not working for PowerPoint
function getDocumentID() {
const XML_NS = 'http://schemas.microsoft.com/office/2006/metadata/properties'
Office.context.document.customXmlParts.getByNamespaceAsync(XML_NS, (result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) return
const part = result.value[0]
part.getNodesAsync('*/documentManagement/*', (result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) return
result.value.forEach((node) => {
if (node.baseName === "_dlc_DocId") {
node.getXmlAsync(result => {
if (result.status === Office.AsyncResultStatus.Succeeded) {
var res = result.value;
documentID = res.substring(res.lastIndexOf('">') + 2, res.lastIndexOf("</"));
console.log(documentID);
} else {
console.error('failed to set node text', result.error)
showNotification("Error:", e);
}
})
}
})
})
})
}