Office.js for PowerPoint is the least developed version of the Office.js APIs. Here is Microsoft's page showing all available objects. If it's not on this page, it doesn't exist (yet): PowerPoint Package
How to Access Core Properties / Custom Properties in PowerPoint Office Addin Using Javascript API
I want to access a PowerPoint document's core and custom properties in PowerPoint Office Addin.
I can access these properties using Javascript API in Word and Excel Office Addins.
- https://learn.microsoft.com/en-us/javascript/api/word/word.customproperty?view=word-js-preview
- https://learn.microsoft.com/en-us/javascript/api/word/word.documentproperties?view=word-js-preview
- https://learn.microsoft.com/en-us/javascript/api/excel/excel.custompropertycollection?view=excel-js-preview
- https://learn.microsoft.com/en-us/javascript/api/excel/excel.documentproperties?view=excel-js-preview
But I am unable to find any documentation related to javascript API to access PowerPoint document core or custom properties.
Is it possible to access these properties using Javascript API? If so how can I access them?
2 answers
Sort by: Most helpful
-
-
Sascha Günther 1 Reputation point
2024-01-17T10:53:02.7266667+00:00 @Luqman-Ud-Din Muhammad I was just facing the same challenge, unfortunately Office.js API for PowerPoint still does not provide any function to retrieve custom document properties.
I implemented the following workaround:
- Get PowerPoint OOXML using Office.context.document.getFileAsync
- Parse XML content to retrieve custom properties, they are stored in the file /docProps/custom.xml
<my_file path="docProps/" name="custom.xml"> <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"> <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="2" name="MSIP_Label_87439970-2b0a-43db-8d36-4f1111a97b08_Enabled"> <vt:lpwstr>true</vt:lpwstr> </property> <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="3" name="MSIP_Label_87439970-2b0a-43db-8d36-4f1111a97b08_SetDate"> <vt:lpwstr>2024-01-17T09:59:10Z</vt:lpwstr> </property> <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="4" name="MSIP_Label_87439970-2b0a-43db-8d36-4f1111a97b08_Method"> <vt:lpwstr>Privileged</vt:lpwstr> </property> <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="5" name="MSIP_Label_87439970-2b0a-43db-8d36-4f1111a97b08_Name"> <vt:lpwstr>f87e2893-b95b-4327-95e0-bf1075fe5eb5</vt:lpwstr> </property> <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="6" name="MSIP_Label_87439970-2b0a-43db-8d36-4f1111a97b08_SiteId"> <vt:lpwstr>f87e2893-b95b-4327-95e0-bf1075fe5eb5</vt:lpwstr> </property> <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="7" name="MSIP_Label_87439970-2b0a-43db-8d36-4f1111a97b08_ActionId"> <vt:lpwstr>f87e2893-b95b-4327-95e0-bf1075fe5eb5</vt:lpwstr> </property> <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="8" name="MSIP_Label_9859f7d1-b5ca-451d-95f2-7d810ca64a9f_ContentBits"> <vt:lpwstr>0</vt:lpwstr> </property> </Properties> </my_file>
Hope that helps!