Reputation: 2978
I just start working on new project to create Add-in for Power Point documents. I spent a lot of time browsing the documentation without finding what I want. It seems that I'm missing something about this documentation.
I was excepting to see all objects (with their properties and methods) like Microsoft did with C#, VB ... but that's not the case. For example, I'm looking for a way to get custom properties for a given Power Point document.
Within my js file, I did this:
var pptDocument = Office.context.document;
pptDocument.loadCustomPropertiesAsync(customPropsCallback);
I used loadCustomPropertiesAsync
because It's implemented with outlook.
What function can I use here in this specific case?
In general, How can I see all methods and properties of the document
object in Power Point Add-in?
EDIT:
What I want to achieve?
Within my Add-in, I would like to add (or update if exists) a custom property. So When I navigate to my PPT custom properties table, I can see that custom property in the properties table. Of course, I want to save the changes so If I close and open the file, the custom property remains there.
Navigate to custom properties in Power Point 2016: File => Info => Properties => Advanced Properties => Custom tab
Upvotes: 1
Views: 1582
Reputation: 5046
I am assuming you are referring to custom document properties. Unfortunately in PPT is still not possible to get them. It is in Word and very soon in Excel. Please vote for this feature in UserVoice, who we consider to prioritize what we'll deliver in the future. thanks!
btw this is how to do it in word.
function readCustomDocumentProperties() {
Word.run(function (context) {
var properties = context.document.properties.customProperties;
context.load(properties);
return context.sync()
.then(function () {
for (var i = 0; i < properties.items.length; i++)
console.log("Property Name:" + properties.items[i].key + ";Type=" + properties.items[i].type + "; Property Value=" + properties.items[i].value);
})
.catch(OfficeHelpers.Utilities.log);
})
}
Upvotes: 1