expression.AddTextEffect(PresetTextEffect, Text, FontName, FontSize, FontBold, FontItalic, Left, Top)
expression Required. An expression that returns one of the objects in the Applies To list.
PresetTextEffect Required MsoPresetTextEffect. The preset text effect to use. 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).
MsoPresetTextEffect can be one of these MsoPresetTextEffect constants. |
msoTextEffect1 |
msoTextEffect2 |
msoTextEffect3 |
msoTextEffect4 |
msoTextEffect5 |
msoTextEffect6 |
msoTextEffect7 |
msoTextEffect8 |
msoTextEffect9 |
msoTextEffect10 |
msoTextEffect11 |
msoTextEffect12 |
msoTextEffect13 |
msoTextEffect14 |
msoTextEffect15 |
msoTextEffect16 |
msoTextEffect17 |
msoTextEffect18 |
msoTextEffect19 |
msoTextEffect20 |
msoTextEffect21 |
msoTextEffect22 |
msoTextEffect23 |
msoTextEffect24 |
msoTextEffect25 |
msoTextEffect26 |
msoTextEffect27 |
msoTextEffect28 |
msoTextEffect29 |
msoTextEffect30 |
msoTextEffectMixed Not used for this method. |
Text Required String. The text to use for the WordArt object.
FontName Required String. The name of the font to use for the WordArt object.
FontSize Required Variant. The font size to use for the WordArt object. Numeric values are evaluated in points; strings can be in any units supported by Publisher (for example, "2.5 in").
FontBold Required MsoTriState. Determines whether to format the WordArt text as bold.
MsoTriState can be one of these MsoTriState constants. |
msoCTrue Not used with this method. |
msoFalse Do not format the WordArt text as bold. |
msoTriStateMixed Not used with this method. |
msoTriStateToggle Not used with this method. |
msoTrue Format the WordArt text as bold. |
FontItalic Required MsoTriState. Determines whether to format the WordArt text as italic.
MsoTriState can be one of these MsoTriState constants. |
msoCTrue Not used with this method. |
msoFalse Do not format the WordArt text as italic. |
msoTriStateMixed Not used with this method. |
msoTriStateToggle Not used with this method. |
msoTrue Format the WordArt text as italic. |
Left Required Variant. The position of the left edge of the shape representing the WordArt object.
Top Required Variant. The position of the top edge of the shape representing the WordArt object.
Remarks
For the Left and Top arguments, numeric values are evaluated in points; strings can be in any units supported by Publisher (for example, "2.5 in").
The height and width of the WordArt object is determined by its text and formatting.
Use the TextEffect property to return a TextEffectFormat object whose properties can be used to edit an existing WordArt object.
Example
The following example adds a WordArt object to the first page of the active publication.
Dim shpWordArt As Shape
Set shpWordArt = ActiveDocument.Pages(1).Shapes.AddTextEffect _
(PresetTextEffect:=msoTextEffect7, Text:="Annual Report", _
FontName:="Arial Black", FontSize:=24, _
FontBold:=msoFalse, FontItalic:=msoFalse, _
Left:=144, Top:=72)