I am writing a VSTO PowerPoint add-in. One of the things I would like to achieve is to be able to update custom properties programmatically using C#.
If I link a custom property to a text box (using GUI), I am able to display the value of the property in a slide - see the two images below.
If I want to change other existing properties that are not linked, it works as expected using this code:
doc.CustomDocumentProperties[propName].Value = propValue;
However, for linked properties the value is not changed. In Excel, I have been able to change the value by following the link set in the property
DocumentProperty property = doc.CustomDocumentProperties[propName];
if (property != null && property.LinkToContent && property.LinkSource != null)
{
workbook.Names.Item(property.LinkSource).RefersToRange.Value = propValue;
}
However, I am unable to find something like this in PowerPoint.
Alternatively, I was wondering if i could solve this by deleting the custom property and then recreating it with the new value. But I can't seem to find a method to delete custom property either.