April 2006
Beginner
1114 pages
98h 16m
English
OLE objects, such as Word documents, WordArt, and form controls can be inserted using the OLEObjects collection or the Shapes collection. The OLEObjects.Add method is equivalent to the Shapes.AddOLEObject method—in fact, they take the same arguments. I cover the OLEObjects collection in Chapter 10, so I won’t repeat that information here. However, the Shapes collection’s AddTextEffect method is worth mentioning because it provides a shortcut to adding an embedded WordArt object
.
The following code inserts a WordArt object on the active worksheet, sets the text properties, then displays a picture on top of the WordArt as shown in Figure 18-9:
Sub InsertWordArt( )
Dim ws As Worksheet, s As Shape
Set ws = ActiveSheet
' Insert the WordArt.
Set s = ws.Shapes.AddTextEffect(msoTextEffect1, "Wombat!", "Arial", 36, _
True, False, 100, 200)
' Change the color of the WordArt
s.Fill.ForeColor.RGB = &HFF
' Display picture using previous example.
InsertPicture
End Sub
Figure 18-9. WordArt combined with a transparent image
Read now
Unlock full access