VBA & Macro Problems

How to Add Custom Metadata Tags to a PowerPoint Presentation Using VBA

Kushani NimanthikaKushani Nimanthika Oct 28, 2026 868 views

Question details

The user wants to attach custom metadata tags containing named text strings to shapes, slides, or the entire presentation using VBA.

How to Add Custom Metadata Tags to a PowerPoint Presentation
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA Editor

Press ALT + F11 in PowerPoint to launch the Visual Basic for Applications editor.

2
Insert a New Module

Click 'Insert' > 'Module' from the top menu to create a new blank script area where you can write your macro.

3
Add a Tag to a Selected Shape

To tag the currently selected shape, use the following code inside your subroutine: ActiveWindow.Selection.ShapeRange(1).Tags.Add "MyTagName", "MyTagValue"

4
Add a Tag to a Specific Slide

To attach metadata to a specific slide (e.g., Slide 42), use: ActivePresentation.Slides(42).Tags.Add "SlideTag", "TagValue"

5
Add a Tag to the Entire Presentation

To tag the entire presentation file, use: ActivePresentation.Tags.Add "DocTag", "DocValue"

6
Execute the Macro

Press F5 or click the 'Run' button in the toolbar to execute your code and apply the tags to your designated objects.

Use VBA Code to Add Tags to Shapes, Slides, or Presentations
Retrieving Tags: You can retrieve these tags later using the .Tags("MyTagName") property on the respective object to check its stored value.
Free Microsoft Office alternative

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.

Fully compatible with Microsoft PowerPoint (.ppt, .pptx, .pptm) formats.Lightweight installation with incredibly fast startup times.Familiar ribbon interface ensures a seamless migration with zero learning curve.Built-in robust tools for presentation design, animation, and slide management.
microsoft office alternative - wps office

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.