#1
|
||||
|
||||
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
|
#2
|
||||
|
||||
Hi Jennifer,
Try: Code:
Application.CommandBars("WordArt").Controls(1).Execute AddTextEffect(PresetTextEffect, Text, FontName, FontSize, FontBold, FontItalic, Left, Top) Thus you have: Code:
AddTextEffect(PresetTextEffect:=msoTextEffect1, Text:=char, FontName:=Font, FontSize:=36#, _ FontBold:=msoFalse, FontItalic:=msoFalse, Left:=239.25, Top:=233.6)
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to insert paragraph character after every 500 characters? | aditya_bokade | Word VBA | 28 | 11-13-2021 10:48 PM |
Macro to find text in between two characters and then format selected text? | qcom | Word | 5 | 02-19-2015 11:23 PM |
Macro to insert new page... | samanthaj | Word | 17 | 01-31-2012 01:53 PM |
Macro for Picture Insert | rfhall50 | Word VBA | 2 | 10-25-2010 12:41 PM |
Junk characters (box-like characters) in Word file | Sashikala | Word | 1 | 04-20-2010 02:03 PM |