共用方式為


Shapes.AddTextEffect Method (Excel)

Creates a WordArt object. Returns a Shape object that represents the new WordArt object.

Syntax

expression .AddTextEffect(PresetTextEffect, Text, FontName, FontSize, FontBold, FontItalic, Left, Top)

expression A variable that represents a Shapes object.

Parameters

Name

Required/Optional

Data Type

Description

PresetTextEffect

Required

MsoPresetTextEffect

The preset text effect.

Text

Required

String

The text in the WordArt.

FontName

Required

String

The name of the font used in the WordArt.

FontSize

Required

Single

The size (in points) of the font used in the WordArt.

FontBold

Required

MsoTriState

The font used in the WordArt to bold.

FontItalic

Required

MsoTriState

The font used in the WordArt to italic.

Left

Required

Single

The position (in points) of the upper-left corner of the WordArt's bounding box relative to the upper-left corner of the document.

Top

Required

Single

The position (in points) of the upper-left corner of the WordArt's bounding box relative to the top of the document.

Return Value

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.

Example

This example adds WordArt that contains the text "Test" to myDocument.

Set myDocument = Worksheets(1) 
Set newWordArt = myDocument.Shapes.AddTextEffect( _ 
    PresetTextEffect:=msoTextEffect1, Text:="Test", _ 
    FontName:="Arial Black", FontSize:=36, _ 
    FontBold:=msoFalse, FontItalic:=msoFalse, Left:=10, _ 
    Top:=10)

請參閱

概念

Shapes Object

Shapes Object Members