Prev: "Followed Hyperlink" color doesn't change in PPT 2007, as in 2003
Next: removal of text shadow ran amonk
From: dsmith via OfficeKB.com on 18 Jan 2010 00:46 I've written vba macro to insert a textbox into my powerpoint slide presentation, but I want to emphasize a specific word or words in the text box by changing its color to red. I only want the word to be red, not the entire content of the textbox. Can this be done? Are there examples? thnaks -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.aspx/powerpoint/201001/1
From: John Wilson john AT technologytrish.co DOT on 18 Jan 2010 03:43 Maybe something like this: Sub texty() Dim otxR As TextRange Set otxR = ActivePresentation.Slides(1).Shapes.AddTextbox _ (msoTextOrientationHorizontal, 10, 10, 200, 10).TextFrame.TextRange With otxR ..Text = "This word is red" ..Words(2).Font.Color = vbRed End With End Sub John -- john ATSIGN PPTAlchemy.co.uk Free PPT Hints, Tips and Tutorials http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html "dsmith via OfficeKB.com" wrote: > I've written vba macro to insert a textbox into my powerpoint slide > presentation, but I want to emphasize a specific word or words in the text > box by changing its color to red. I only want the word to be red, not the > entire content of the textbox. Can this be done? Are there examples? > thnaks > > -- > Message posted via OfficeKB.com > http://www.officekb.com/Uwe/Forums.aspx/powerpoint/201001/1 > > . >
From: Mark on 18 Jan 2010 08:29 On Jan 18, 12:46 am, "dsmith via OfficeKB.com" <u56186(a)uwe> wrote: > I've written vba macro to insert a textbox into my powerpoint slide > presentation, but I want to emphasize a specific word or words in the text > box by changing its color to red. I only want the word to be red, not the > entire content of the textbox. Can this be done? Are there examples? > thnaks > > -- > Message posted via OfficeKB.comhttp://www.officekb.com/Uwe/Forums.aspx/powerpoint/201001/1 Try this, I believe it should do what you want: Private Function colorText(ByRef txtrng As textRange, ByVal SearchString As String, Optional ByVal textColor As RGBColor = vbRed) Dim foundText As textRange Set foundText = txtrng.Find(FindWhat:=SearchString) Do While Not (foundText Is Nothing) With foundText .Font.Color.RGB = textColor End With Loop End Function
From: David Marcovitz on 19 Jan 2010 14:18
On 1/18/10 12:46 AM, in article a247bd7ce9b91(a)uwe, "dsmith via OfficeKB.com" <u56186(a)uwe> wrote: > I've written vba macro to insert a textbox into my powerpoint slide > presentation, but I want to emphasize a specific word or words in the text > box by changing its color to red. I only want the word to be red, not the > entire content of the textbox. Can this be done? Are there examples? > thnaks Example 6.8 on my site changes the color of some text in a text box. See Examples by Chapter and Chapter 6 on http://www.PowerfulPowerPoint.com/ --David -- David M. Marcovitz Author of _Powerful PowerPoint for Educators_ http://www.PowerfulPowerPoint.com/ Microsoft PowerPoint MVP Associate Professor, Loyola University Maryland |