Name
shapes
.AddTextEffect(PresetTextEffect
, Text
, FontName
, FontSize
, FontBold
, FontItalic
, Left
, Top
)
Synopsis
Adds a WordArt embedded object and returns the Shape
object for the embedded object.
Argument |
Settings |
---|---|
|
An |
|
The text to embed. |
|
The name of the font to use. |
|
The size of the font in points. |
|
True uses bold; False uses the normal weight font. |
|
True uses italic font; False uses roman. |
|
The horizontal position of the shape in points. |
|
The vertical position of the shape in points. |
Use the TextEffect
property, not TextFrame
, to change the text or appearance of the embedded WordArt object. The following code embeds a WordArt object, then changes its text:
Sub EmbedWordArt( ) Dim ws As Worksheet, s As Shape Set ws = ActiveSheet ' Create label (height/width will be set by AutoSize). Set s = ws.Shapes.AddTextEffect(msoTextEffect19, "Wombat!", "Arial", 36, _ True, False, 100, 100) ' Change text. s.TextEffect.text = "New Text" End Sub
Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.