PowerPoint VBA - turn fill color of Text to No Fill

I have Titles on my PowerPoint slides so that they appear on the Outline. I don't want these Titles to appear on the presentation.

I need to programatically turn the Fill color of the text to No Fill. And back again to Black.

Can someone show me the VBA code for this please?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fabrice LambertConsultingCommented:
Can you provide a sample document ?
Jamie GarrochSenior Technical Consultant at BrightCarbonCommented:
Try this:

Option Explicit

' ============================================================================
' PowerPoint macros to toggle the fill colour for all Titles in a presentation
' Author : Jamie Garroch, BrightCarbon (http://brightcarbon.com)
' Date : 15NOV2018
' ============================================================================

Public Sub TurnOnTitles()
  SwitchTitleFill True
  'SwitchTitleVisible True
End Sub

Public Sub TurnOffTitles()
  SwitchTitleFill False
  'SwitchTitleVisible False
End Sub

' Toggles the title placeholder font fill
Private Sub SwitchTitleFill(bVisible As Boolean)
  Dim oSld As Slide
  For Each oSld In ActivePresentation.Slides
    With oSld.Shapes.Title.TextFrame2.TextRange.Font
      If bVisible Then .Fill.ForeColor.RGB = vbBlack
      .Fill.Visible = bVisible
    End With
End Sub

' Toggles the title placeholder visible property
Private Sub SwitchTitleVisible(bVisible As Boolean)
  Dim oSld As Slide
  For Each oSld In ActivePresentation.Slides
    oSld.Shapes.Title.Visible = bVisible
End Sub

Open in new window

There are two alternative procedures for hiding the title placeholder. The first one does what you asked and the second one is simpler in that it just toggles the visible property, as used in the Alt+F10 Selection Pane.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hindersalivaAuthor Commented:
That's perfect Jamie!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.