macro with font size

R

rog

Hello

I'm trying to creat a macro which changes the font size and the font type
and the color of the characters, however when I execute the macro only the
color changes but keeps the font size and the font type.

Any idea how to solve this?

Thanks
 
M

mpt

I created macro to do same thing and all changes took when I executed macro.
It works whether I highlight target text first then executed macro or if I
just execute without highlighting and then start typing.
 
R

rog

That's a good idea, here is my macro:

Sub text()
'
' text Macro
'
Selection.TypeText text:="Hola"
Selection.MoveLeft Unit:=wdCharacter, Count:=4, Extend:=wdExtend
CommandBars("Formatting").Visible = True
Selection.Font.Color = wdColorLightOrange
End Sub
 
R

rog

That's a good idea, here is my macro:

Sub text()
'
' text Macro
'
Selection.TypeText text:="Hola"
Selection.MoveLeft Unit:=wdCharacter, Count:=4, Extend:=wdExtend
CommandBars("Formatting").Visible = True
Selection.Font.Color = wdColorLightOrange
End Sub
 
M

mpt

Good idea, indeed. Here's what I recorded:

Sub Junk()
With Selection.Font
.Name = "BD Miami Skyline"
.Size = 18
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorBlue
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
End With
End Sub
 

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