A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Powerpoint
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Changing text color within a text box using VBA



 
 
Thread Tools Display Modes
  #1  
Old March 2nd, 2007, 04:37 PM posted to microsoft.public.powerpoint
camler
external usenet poster
 
Posts: 4
Default Changing text color within a text box using VBA

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.
  #2  
Old March 2nd, 2007, 05:01 PM posted to microsoft.public.powerpoint
David M. Marcovitz
external usenet poster
 
Posts: 1,267
Default Changing text color within a text box using VBA

This code will do that for shape 1 on slide 1:

ActivePresentation.Slides(1).Shapes(1).TextFrame.T extRange. _
Paragraphs(1).Font.Color.RGB = vbBlack
ActivePresentation.Slides(1).Shapes(1).TextFrame.T extRange. _
Paragraphs(2).Font.Color.RGB = vbBlue
ActivePresentation.Slides(1).Shapes(1).TextFrame.T extRange. _
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/

=?Utf-8?B?Y2FtbGVy?= wrote in
:

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.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.