Shapes.AddTextEffect Method

Adds a WordArt shape to a document. Returns a Shape object that represents the WordArt and adds it to the Shapes collection.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Function AddTextEffect ( _
    PresetTextEffect As MsoPresetTextEffect, _
    Text As String, _
    FontName As String, _
    FontSize As Single, _
    FontBold As MsoTriState, _
    FontItalic As MsoTriState, _
    Left As Single, _
    Top As Single, _
    ByRef Anchor As Object _
) As Shape
'Usage
Dim instance As Shapes
Dim PresetTextEffect As MsoPresetTextEffect
Dim Text As String
Dim FontName As String
Dim FontSize As Single
Dim FontBold As MsoTriState
Dim FontItalic As MsoTriState
Dim Left As Single
Dim Top As Single
Dim Anchor As Object
Dim returnValue As Shape

returnValue = instance.AddTextEffect(PresetTextEffect, _
    Text, FontName, FontSize, FontBold, _
    FontItalic, Left, Top, Anchor)
Shape AddTextEffect(
    MsoPresetTextEffect PresetTextEffect,
    string Text,
    string FontName,
    float FontSize,
    MsoTriState FontBold,
    MsoTriState FontItalic,
    float Left,
    float Top,
    ref Object Anchor
)

Parameters

  • PresetTextEffect
    Type: MsoPresetTextEffect
    Required MsoPresetTextEffect. A preset text effect. The values of the MsoPresetTextEffect constants correspond to the formats listed in the WordArt Gallery dialog box (numbered from left to right and from top to bottom).
  • Text
    Type: System.String
    Required String. The text in the WordArt.
  • FontName
    Type: System.String
    Required String. The name of the font used in the WordArt.
  • FontSize
    Type: System.Single
    Required Single. The size, in points, of the font used in the WordArt.
  • FontBold
    Type: MsoTriState
    Required MsoTriState. MsoTrue to bold the WordArt font.
  • FontItalic
    Type: MsoTriState
    Required MsoTriState. MsoTrue to italicize the WordArt font.
  • Left
    Type: System.Single
    Required Single. The position, measured in points, of the left edge of the WordArt shape relative to the anchor.
  • Top
    Type: System.Single
    Required Single. The position, measured in points, of the top edge of the WordArt shape relative to the anchor.
  • Anchor
    Type: System.Object%
    Optional Object. A Range object that represents the text to which the WordArt is bound. If Anchor is specified, the anchor is positioned at the beginning of the first paragraph in the anchoring range. If this argument is omitted, the anchoring range is selected automatically and the WordArt is positioned relative to the top and left edges of the page.

Return Value

Type: Microsoft.Office.Interop.Word.Shape

Remarks

When you add WordArt to a document, the height and width of the WordArt are automatically set based on the size and amount of text you specify.

See Also

Reference

Shapes Interface

Shapes Members

Microsoft.Office.Interop.Word Namespace