Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

VBA Visual Basic for Applications (Microsoft) FAQ


A Quick introduction to Slides Tags by Chance1234
Posted: 23 Mar 06

One of the most useful things i find when programming in powerpoint is Slide Tags.

Tags allow the developer to assign extra information to a slide in a presentation and retrieve it via code

In the following example which is cut down from a routine which creates a new presenation and adds various slides

I am adding one tag to my new slides, which i have simply titled "Orient" being short for orientation. My presenation

contains a mix of horizontal and vertical slides, so i can print them properly (see other faq) I assign and read this tag

heres the code for adding a tag to a slide


Global pp_Final As New Presentation ' No need for new word  in XP
Global pp_Tools As Presentation ' This Presentation

Sub example
Dim sld_Temp As Slide 'tempoary slide

'create a new presentation
Set pp_Final = Application.Presentations.Add

'My actual code this is coming from contains a loop here which
'calls different elements and copies slides from another presentation inserting them
'into the new presentation, you will need to change the below to suit your needs

pp_Vert.Slides("sldifa").Copy 'this is the line that needs changing
pp_Final.Slides.Paste 'this is the paste

Set sld_Temp = pp_Final.Slides(2) ' number being the new slide i have bought in ' again change for needs

'Now we come to the tag!

 sld_Temp.Tags.Add "Orient", "V" ' the V is the value im assigning to this tag

end sub

Now to retrieve the tag value from all slides in a presenation the code looks like this


For Each var In pp_Final.Slides
    debug.print  var.Tags("Orient")

Please see my FAQ on working with Horizontal and Vertical slides for a practical example

Back to VBA Visual Basic for Applications (Microsoft) FAQ Index
Back to VBA Visual Basic for Applications (Microsoft) Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close