View Single Post
 
Old 02-22-2014, 10:17 AM
Jennifer Murphy's Avatar
Jennifer Murphy Jennifer Murphy is offline Windows XP Office 2007
Competent Performer
 
Join Date: Aug 2011
Location: Silicon Valley
Posts: 234
Jennifer Murphy is on a distinguished road
Default Macro to insert WordArt characters

I need a macro to insert WordArt characters using the WordArt Style 1 (outline). I want to be able to enter the text and select the font.

Using the macro recorder, I came up with this:

Code:
Sub MyWordArtOutline()
Const MyName As String = "MyWordArtOutline"
Dim InString As String  'The string of characters to be inserted
Dim i As Long
Dim Font As String
Dim char As String

InString = InputBox("Enter the string", MyName)
Font = InputBox("Enter the name of the font", MyName)
For i = 1 To Len(InString)
  char = Mid(InString, i, 1)
  ActiveDocument.Shapes.AddTextEffect(msoTextEffect1, char, _
    Font, 36#, msoFalse, msoFalse, 239.25, 233.6).Select
  Selection.MoveRight Unit:=wdCharacter, Count:=1
Next i

End Sub
It works, but it could work better. I have a few questions:

  1. Is there any way for the macro to put the list of available fonts so the user can select one, instead of having to type in the name?
  2. The WordArt letters some in in the middle of the page and all on top of each other. How can I get them to be side by side at the cursor?
  3. Can anyone explain what the other WordArt parameters mean (msoFalse, 239.25, 233.6?
Thanks
Reply With Quote