![]() |
#1
|
|||
|
|||
![]()
Hi. I'm not the best with macros and VBA but I have a macro that I use to style documents that I want to apply to all files spread throughout a series of subdirectories. I've been trying a few things that I've seen suggested here and there but I haven't figured out anything that works. The macro I want to apply is as follows:
Sub QuickFormat() ' ' QuickFormat Macro ' Quick Format for Books ' Selection.WholeStory With Selection.ParagraphFormat .SpaceBefore = 0 .SpaceBeforeAuto = False .SpaceAfter = 0 .SpaceAfterAuto = False .LineSpacingRule = wdLineSpaceSingle .LineUnitBefore = 0 .LineUnitAfter = 0 End With Selection.Find.Execute Replace:=wdReplaceAll ActiveWindow.ActivePane.LargeScroll Down:=3 Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^l" .Replacement.Text = "^p" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll ActiveWindow.ActivePane.LargeScroll Down:=3 Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^p" .Replacement.Text = "^p^p" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll ActiveWindow.ActivePane.LargeScroll Down:=3 Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^p " .Replacement.Text = "^p" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll ActiveWindow.ActivePane.LargeScroll Down:=3 Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^p " .Replacement.Text = "^p" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.WholeStory With Selection.ParagraphFormat .SpaceBefore = 0 .SpaceBeforeAuto = False .SpaceAfter = 0 .SpaceAfterAuto = False .LineSpacingRule = wdLineSpaceSingle .CharacterUnitFirstLineIndent = 0 .LineUnitBefore = 0 .LineUnitAfter = 0 End With Selection.MoveLeft Unit:=wdCharacter, Count:=1 Selection.WholeStory Selection.LanguageID = wdEnglishAUS Application.CheckLanguage = False Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^p^p^p^p" .Replacement.Text = "^p^p" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll End Sub Any help would be greatly appreciated. |
Tags |
docx, subdirectories, vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Peter Carter | Word VBA | 27 | 12-15-2022 04:10 PM |
![]() |
terenceyip | Word VBA | 4 | 03-20-2019 05:56 PM |
How to go through subdirectories in the following macro | Kazona | Word VBA | 0 | 09-09-2013 06:59 AM |
![]() |
Mhangoy | Word | 6 | 09-06-2013 06:57 AM |
Help! Can't Get Macro To Work In .docx Opened Off A Website | Mhangoy | Word VBA | 0 | 08-29-2013 03:02 AM |