Changing text color within a text box using VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am building a presentation and slide using VBA. I have a text box that is
added to the slide. All of this works well. Is there a way to change the
text properties in the text box when adding addtional text to the existing
text? I have three lines of text in the text box. I want the first line to
be black, the second to be blue, and the third to be red.

Any help is greatly appreciated.
 
This code will do that for shape 1 on slide 1:

ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange. _
Paragraphs(1).Font.Color.RGB = vbBlack
ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange. _
Paragraphs(2).Font.Color.RGB = vbBlue
ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange. _
Paragraphs(3).Font.Color.RGB = vbRed

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
Back
Top