OfficeTips Home || VBA Section || General Section || Download Section || Privacy Policy

Assign a Glow to Shape and Text

The new graphics engine in Office 2007 brings to fore a whole slew of new effects which makes the presentation richer. Reflection, soft shadows, 3D effects. glows and more. We shall see how to assign the glow effect to the shape and text in this example.

The new TextRange2 object exposes the new objects/properties for text in PPT 2007. Glow object has two properties that can be made use of Radius and Color. Radius sets the size of the glow area. A radius of 10 would mean a glow of 5 points extending from the outer edges of the shape.

 

Sub AssignGlow()

Dim oShp As Shape
Dim oSld As SlideSet oSld = ActivePresentation.Slides(1)

Set oShp = oSld.Shapes.AddShape(msoShapeRectangle, 100, 100, 200, 200)
With oShp
    .Glow.Radius = 20
'20 is the upper limit of the value that can be set for a glow.
    .Glow.Color = RGB(0, 0, 255)
'Set the color to Blue
   
    With .TextFrame2.TextRange  
'Make use of the new object to access Glow for text
        .Text = "This should glow"
        .Font.Glow.Radius = 10
        .Font.Glow.Color = RGB(255, 0, 0)
    End With

End With

End Sub