How to Add Custom Metadata Tags to a PowerPoint Presentation Using VBA
Question details
The user wants to attach custom metadata tags containing named text strings to shapes, slides, or the entire presentation using VBA.

- Product
- Microsoft PowerPoint
- Device & OS
- not provided
- Scenario
- Organizing, labeling, or tracking specific shapes, slides, or presentations programmatically via backend metadata.
- Observed behavior
- The user needs the correct VBA syntax to add and store custom metadata tags at the shape, slide, or presentation level.
Ensure that the Developer tab is enabled in your PowerPoint ribbon and that your presentation is saved as a Macro-Enabled Presentation (.pptm) to prevent losing your VBA scripts.
Use VBA Code to Add Tags to Shapes, Slides, or Presentations
Use PowerPoint's built-in VBA editor to programmatically attach named string values as tags to various objects.
PowerPoint tags are invisible to the standard user interface but can be easily read and written via VBA. They are extremely useful for storing custom data directly within a shape or slide object for backend tracking or automated processing.
Press ALT + F11 in PowerPoint to launch the Visual Basic for Applications editor.
Click 'Insert' > 'Module' from the top menu to create a new blank script area where you can write your macro.
To tag the currently selected shape, use the following code inside your subroutine: ActiveWindow.Selection.ShapeRange(1).Tags.Add "MyTagName", "MyTagValue"
To attach metadata to a specific slide (e.g., Slide 42), use: ActivePresentation.Slides(42).Tags.Add "SlideTag", "TagValue"
To tag the entire presentation file, use: ActivePresentation.Tags.Add "DocTag", "DocValue"
Press F5 or click the 'Run' button in the toolbar to execute your code and apply the tags to your designated objects.

Try WPS Office for Seamless Presentation Management
WPS Office is a powerful, lightweight, and free alternative to Microsoft Office. It offers high compatibility with PowerPoint formats and features a familiar interface, making it easy to create, edit, and manage your presentations without a steep learning curve.

Frequently Asked Questions
Can I view PowerPoint tags without using VBA?
No, PowerPoint does not provide a built-in graphical user interface to view, add, or edit custom metadata tags. You must use VBA macros or install third-party add-ins to interact with these tags.
Are custom tags preserved when saving as a standard .pptx file?
Yes, the metadata tags attached to shapes or slides are saved natively within standard .pptx files. However, the actual VBA code used to generate or read them will be lost unless you save the file as a Macro-Enabled Presentation (.pptm).
How do I delete a custom tag using VBA?
You can remove a tag by using the .Tags.Delete method. For example, using ActivePresentation.Tags.Delete ("MyTagName") will completely remove the specified tag from the presentation.




