Skip to content

Read Slide and Shape tags #578

Description

@CrunchCube

Witin PowerPoint VBA it is possible to add custom properties for a shape, slide, or presentation. These are set as tags with a key value pair. eg ActivePresentation.Slides(1).Tags.Add "Region", "East"

It is then possible to read (and or update) these custom properties using the tag key eg val = ActivePresentation.Slides(1).Tags("Region") or looping over all the tags to get a specific one

eg

With shape
For i = 1 To Tags .Count step 1
If .Name(i) = "PRIORITY" Then
do something
End If
Next
End With

I use this feature for ppt automation and configuration. I'm transition over to python and using python-pptx I'm unable to work with these custom tags. Is it possible to add the ability to read these tags (custom properties) for presentations, slide and shapes through the api for example

for tag in shape.tags:
if tag.name == 'MOD'
do something

or

for tag in shape.tags:
if tag('MOD') == 'REFORMAT:
do something

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions