Consulting

Results 1 to 8 of 8

Thread: Format Text

  1. #1

    Format Text

    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

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    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
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    Thanks John, this works absolutely perfect!

  4. #4
    VBAX Newbie
    Joined
    Sep 2016
    Posts
    3
    Location
    is it possible to apply the glow ONLY to selected text, as opposed to all the text in the shape?

  5. #5
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    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
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  6. #6
    VBAX Newbie
    Joined
    Sep 2016
    Posts
    3
    Location
    Excellent! Thank you so much John!

  7. #7
    VBAX Newbie
    Joined
    Sep 2016
    Posts
    3
    Location
    is it possible to convert that code to an excel-compatible version?

  8. #8
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    Not easily
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •