Macro to Change Document Font in All Documents in a Folder
Hi All!
My ultimate goal is to write a macro that can be used via a simple Word shortcut key to 1) select a folder and 2) format the font of all Word documents in that folder.
I have been attempting to write a macro that can do the following:
1) Set all font to Times New Roman
2) Set all font size to 12 point
3) Remove text shading
4) Set font color to Automatic
5) Set scaling to 100%
I have tried recording a macro to do this but it only works on the document I have open. The macro is below:
Sub TestMacro()
'
' TestMacro Macro
'
'
Selection.WholeStory
Selection.Shading.Texture = wdTextureNone
Selection.Shading.ForegroundPatternColor = wdColorAutomatic
Selection.Shading.BackgroundPatternColor = wdColorAutomatic
Selection.Font.Name = "Times New Roman"
Selection.Font.Size = 12
With Selection.Font
.NameFarEast = "+Body Asian"
.NameAscii = "Times New Roman"
.NameOther = "Times New Roman"
.Name = "Times New Roman"
.Size = 12
.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 = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
.DisableCharacterSpaceGrid = False
.EmphasisMark = wdEmphasisMarkNone
.SizeBi = 12
.NameBi = "Times New Roman"
.BoldBi = False
.ItalicBi = False
.Ligatures = wdLigaturesNone
.NumberSpacing = wdNumberSpacingDefault
.NumberForm = wdNumberFormDefault
.StylisticSet = wdStylisticSetDefault
.ContextualAlternates = 0
End With
End Sub
My problem is that I don't know how to get this to work on batches of documents in a folder. Can anyone point in the right direction to accomplish this? Thank you so much for your help!
|