|
||
---|---|---|
PowerPoint tips, hints and tutorials that will change your presentations for ever! | ||
Jigsaws |
Powerpoint vba - Using Tags Tags are a very useful feature and often overlooked by vba programmers. Tags are like labels that you can attach to a PowerPoint Presentation, Slide or Shape. They can only be "seen" in vba are remain totally invisible to the normal user. Tags have a Name and a Value associated with that name. You can attach many Tags to an object. The tag name and value should be strings. Note case is not considered by tags "thistag" is the same as "ThiStaG". By convention Upper case is usually used. Add Tags to a Range of Slides This code adds a tag named "type" to all selected slides and sets the value at "one" Sub AddTags() 'change to suit 'check for selection 'add tags This code does the same for a range of shapes on a slide Sub AddTags() 'change to suit 'check for selection 'add tags To use a tag Hides tagged shapes on slide one For Each oshp In ActivePresentation.Slides(1).Shapes OR Hides tagged slides in Presentation For Each osld In ActivePresentation.Slides Enumerate the Tags on Shapes for a Given Slide Sub Show_Tags() Dim i As Long Set osld = ActiveWindow.View.Slide With osld.Tags For i = 1 To .Count Next oShp Use a Function to Read a Tag Function readtag(oshp As Shape, strTagname As String)
As String To Use this Function MsgBox readtag(oshp, "ALT") ' where ALT is the tag name
|
|
Articles on your favourite sport Free Microsoft PowerPoint Advice, help and tutorials, Template Links |