Log in

View Full Version : [SOLVED:] Remove Alt Text



magnel
08-12-2014, 03:44 AM
Hello,

I am using PPT 2010 and I am trying to remove the alt text (tooltip) from each shape/object/pictures in the presentation. I am using the below code and it successfully remove alt text from all the objects from the presentation. But it does not remove the alt text from the master slides.


Sub BlankTheAltText()
Dim oSl As Slide
Dim oSh As Shape
For Each oSl In ActivePresentation.Slides
For Each oSh In oSl.Shapes
oSh.AlternativeText = ""
Next
Next
End Sub


Please can you help to get the appropriate code to remove the alt text from the objects in slide master as well.

Thanks

John Wilson
08-12-2014, 07:33 AM
See if this does it:


Sub BlankAllTheAltText()
Dim oSl As Slide
Dim oSh As Shape
Dim oDes As Design
Dim oCust As CustomLayout
On Error Resume Next
'only if you have multiple masters
For Each oDes In ActivePresentation.Designs
'slidemaster shapes
For Each oSh In oDes.SlideMaster.Shapes
oSh.AlternativeText = ""
Next oSh
'layout shapes
For Each oCust In oDes.SlideMaster.CustomLayouts
For Each oSh In oCust.Shapes
oSh.AlternativeText = ""
Next oSh
Next oCust
Next oDes 'other masters
'slide shapes
For Each oSl In ActivePresentation.Slides
For Each oSh In oSl.Shapes
oSh.AlternativeText = ""
Next oSh
Next oSl
End Sub

magnel
08-12-2014, 11:38 AM
Thank you so much John, the code is working great.