![]() |
|
#4
|
||||
|
||||
|
Simply change all of your:
Code:
With wdDoc ... End With Code:
With wdDoc
' copy the styles
.CopyStylesFromTemplate ("C:\Users\Terence Yip\AppData\Roaming\Microsoft\Templates\normal.dotm")
' replace headings
With .Range.Find
.Find.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.Style = "Heading 7"
.Replacement.Style = "Heading 4"
.Execute Replace:=wdReplaceAll
.Style = "Heading 8"
.Replacement.Style = "Heading 5"
.Execute Replace:=wdReplaceAll
.Style = "Heading 9"
.Replacement.Style = "Heading 6"
.Execute Replace:=wdReplaceAll
End With
'Save and close the document
.Close True
End With
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Run a macro on multiple docx. files
|
Peter Carter | Word VBA | 27 | 12-15-2022 04:10 PM |
| Macro for multiple RTF files | papapaleo | Word VBA | 1 | 07-28-2017 04:56 AM |
Seach ''WORD'' in multiple doc/docx files (different folders!) at the same time
|
Abcde | Word VBA | 22 | 06-01-2017 10:33 PM |
Macro to change all text color to black in all docx files in a selected folder
|
joewoods | Word VBA | 13 | 05-16-2016 06:29 PM |
looking for macro for multiple files
|
bolk | Word | 3 | 05-03-2011 05:46 AM |