PDA

View Full Version : Format Text



magnel
08-19-2014, 12:43 PM
Hello,

I am using PPT 2010 and I am trying to add glow to text with the following piece of code.

Sub TextGlow()
Dim oshp1 As Shape
Set oshp1 = ActiveWindow.Selection.ShapeRange(1)
With oshp1.TextFrame2.TextRange 'Make use of the new object to access Glow for text
.Font.Glow.Radius = 8
.Font.Glow.Color = RGB(255, 255, 255)
End With
End Sub


I am able to apply the glow only to one textbox at a time. Can I select multiple textboxes and apply this glow to selected textboxes.

Thanks

John Wilson
08-20-2014, 01:05 AM
Sub TextGlow()
Dim oshpR As ShapeRange
On Error GoTo err
Set oshpR = ActiveWindow.Selection.ShapeRange
With oshpR.TextFrame2.TextRange 'Make use of the new object to access Glow for text
.Font.Glow.Radius = 8
.Font.Glow.Color = RGB(255, 255, 0)
End With
Exit Sub
err:
MsgBox "Select shapes with text!"
End Sub

magnel
08-20-2014, 04:04 AM
Thanks John, this works absolutely perfect!

User_1
09-06-2016, 10:30 AM
is it possible to apply the glow ONLY to selected text, as opposed to all the text in the shape?

John Wilson
09-06-2016, 10:36 AM
Sub TextGlow()'NOTE THIS IS FOR 2010 ON
On Error GoTo err
With ActiveWindow.Selection.TextRange2 'Make use of the new object to access Glow for text
.Font.Glow.Radius = 8
.Font.Glow.Color = RGB(255, 255, 0)
End With
Exit Sub
err:
MsgBox "Select text!"
End Sub

User_1
09-06-2016, 11:27 AM
Excellent! Thank you so much John!

User_1
10-10-2016, 08:47 AM
is it possible to convert that code to an excel-compatible version?

John Wilson
10-11-2016, 08:58 AM
Not easily