View Single Post
Old 08-26-2014, 08:00 AM
WH7262 WH7262 is offline Windows Vista Office 2007
Join Date: Aug 2014
Location: Texas
Posts: 7
WH7262 is on a distinguished road
Default Looping Macro to Change Font, Font Size, and Give Heading 1

I need a repeating macro that could do the following in a specified folder:

1. Change all Fonts to Times New Roman
2. All font size to 12
3. Then have the first line of text to have a Style of Heading 1
4. Save the file as .doc

Then possibly have it call another macro to have it do a Save As .docx
Here is the macro I have now.
Sub PageTxtFontHeader1()
' ' PageTxtFontHeader1 Macro ' '
With Selection.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = InchesToPoints(0.6)
.BottomMargin = InchesToPoints(0.6)
.LeftMargin = InchesToPoints(0.6)
.RightMargin = InchesToPoints(0.6)
.Gutter = InchesToPoints(0)
.HeaderDistance = InchesToPoints(0.5)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(11)
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
.TwoPagesOnOne = False
.BookFoldPrinting = False
.BookFoldRevPrinting = False
.BookFoldPrintingSheets = 1
.GutterPos = wdGutterPosLeft
End With
Selection.Font.Name = "Times New Roman"
Selection.Font.Size = 12
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.HomeKey Unit:=wdStory
Selection.Style = ActiveDocument.Styles("Heading 1")

How can I get this to repeat on all of the files in that folder?

Last edited by WH7262; 08-26-2014 at 08:37 AM. Reason: Giving more details
Reply With Quote