When I examine a Legend object in the Locals pane, I don't see the LegendEntries collection.
I learned about LegendEntries only from Microsoft's online documentation.
Why isn't LegendEntries visible from the Locals pane?
What other options do I have to explore the object model besides the Locals pane?
Looking at the Object Browser, you can see that Legend.LegendEntries
is a method (a Function
or Sub
); the Locals pane only displays properties (Property Get
).
It's also presented this way in the documentation of the member (not the docs on the collection itself, but about the member needed to access the collection from Legend
):
Legend.LegendEntries method (PowerPoint)
It's not that obvious in VBA, because VBA doesn't require parentheses when calling a method without parameters. But if you were accessing the PowerPoint object model from a language which does require parentheses for such method calls, you'd see the distinction right away.
Aside from the Microsoft documentation of the Office object models, the Object Browser (View -> Object Browser, or pressing F2) shows all the members of a given type, including the methods.
NB. By default the Object Browser doesn't show "hidden members", nor are they visible in completion list in the code editor window. In order to see such members, right-click anywhere in the Object Browser and choose the Show hidden members option. The hidden members will be displayed in a lighter gray, as in the above screenshot.
Note also that code which uses these hidden members will compile and run successfully, whether or not this option is selected.