how can I create wordart using vba/macros

I

iangers

I want to be able to create Wordart sections in an excel workbook using
VBA/Macros. I can't find out how to add these items to the workbook and the
help isn't helpful, it just tells you how to do it using the menus.

Does any one know how to do this?
 
J

JLGWhiz

Sub createWA()
Set newWordArt = MyDocument.Shapes.AddTextEffect
_(PresetTextEffect:=msoTextEffect 10, Text:="Watch This", _
FontName:=fnt(MyValue), FontSize:= 40, FontBold:=False, _
FontItalic:=False, Left:=ShpLeft250, Top:=ShpTop200)
End Sub
 
J

JLGWhiz

Needed a little more clean-up. I extracted this from code I had written
where I used arrays and variables for the font settings and I missed one of
the variables when I changed it for your use. This should now display a
phrase if run.

Sub createWA()
Set newWordArt = MyDocument.Shapes.AddTextEffect
_(PresetTextEffect:=msoTextEffect 10, Text:="Watch This", _
FontName:="Arial", FontSize:= 40, FontBold:=False, _
FontItalic:=False, Left:=ShpLeft250, Top:=ShpTop200)
End Sub
 
J

JLGWhiz

P.S. The AddTextEffect method is spelled out in the VBA help files You have
to press Alt + F11 to open the VB editor. Then use the help menu from the VB
editor screen to look for AddTextEffect. The Excel help menu has limited VBA
help information.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top