powerpointvstoshapesoffice-addinspowerpoint-addins

Shape property "decorative" not in VSTO?


I program PowerPoint add-ins both in VBA and in VSTO. In VBA I can use shape.Decorative to check, if a shape is decorative - and therefore does not need an alternative text. In VSTO however there is no such property.

I'm using Visual Studio 2022, the reference to PowerPoint is set to version 15.0.0.0.0 - but I can't see where I could change that. Am I using the wrong template?

I'm grateful for any tips how to get to that attribute. Thanks in advance, Sabina


Solution

  • The PowerPoint object model provides the Shape.Decorative property which sets or returns the decorative flag for the specified object. So, it doesn't matter whether it is a VSTO add-ins or VBA macro. The PowerPoint object model is common for all programming languages. In this situation you can:

    1. Use a newer PIA to get access to the property (with intellisense suggestions).
    2. Use the late-binding technology to invoke the property programmatically even when it is not available in PIAs. The Type.InvokeMember method invokes a specific member of the current Type.