CanvasShapes.AddTextEffect (Word)

Adds a WordArt shape to a drawing canvas. Returns a Shape object that represents the WordArt.

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.

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


Sub NewCanvasTextEffect() 
 Dim docNew As Document 
 Dim shpCanvas As Shape 
 
 'Create a new document and add a drawing canvas 
 Set docNew = Documents.Add 
 Set shpCanvas = docNew.Shapes.AddCanvas( _ 
 Left:=100, Top:=100, Width:=150, _ 
 Height:=50) 
 
 'Add WordArt shape to the drawing canvas 
 shpCanvas.CanvasItems.AddTextEffect _ 
 PresetTextEffect:=msoTextEffect20, _ 
 Text:="Hello, World", FontName:="Tahoma", _ 
 FontSize:=15, FontBold:=msoTrue, _ 
 FontItalic:=msoFalse, _ 
 Left:=120, Top:=120 
End Sub

Arguments

The following arguments are required:

PresetTextEffect (Office.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 (String) - The text in the WordArt.

FontName (String) - The name of the font used in the WordArt.

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

FontBold (Office.MsoTriState) - msoTrue to bold the WordArt font. msoFalse to set the font used in the WordArt to regular.

FontItalic (Office.MsoTriState) - msoTrue to italicize the WordArt font. msoFalse to set the font used in the WordArt to regular.

Left (Single) - The position, measured in points, of the left edge of the WordArt shape relative to the left edge of the drawing canvas.

Top (Single) - The position, measured in points, of the top edge of the WordArt shape relative to the top edge of the drawing canvas.