Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

LinkBack Thread Tools Display Modes
Old 08-26-2014, 08:00 AM   #1
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
WH7262 is offline   Reply With Quote
Old 08-26-2014, 03:46 PM   #2
macropod's Avatar
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 17,137
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold

Cross-posted and answered at:
For cross-posting etiquette, please read:

See also:

PS: When posting code, please post formatted code and use the code tags. They're on the 'Go Advanced' tab at the bottom of this screen.
Paul Edstein
[MS MVP - Word]
macropod is offline   Reply With Quote

format style, loop, repeating

Thread Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change in font size of docproperty Sandy27 Word 9 01-03-2014 01:51 PM
Unable to change font size Andoheb Outlook 1 11-23-2012 07:24 PM
how change size font to inches size kkepo Word 4 08-28-2012 08:53 PM
Change font & point size? markg2 Outlook 2 06-09-2010 03:23 PM
Can't change font type or size sideways Word 2 11-01-2009 09:57 AM

All times are GMT -7. The time now is 12:15 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc. is not affiliated with Microsoft