View Single Post
 
Old 10-11-2020, 04:02 PM
Charles Kenyon Charles Kenyon is online now Windows 10 Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,128
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

I have not looked at your code, sorry.
Here is my template that copies heading styles to the Active Document through a macro which is documented in the template.
Outline Heading Styles Global Stylesheet Add-In

You do not need to attach the normal template or any template to copy all of the styles or selected from it.

If using OrganizerCopy method, you should do it for all styles three times if any of the styles are based on another style being copied. (This may be superstition but I've done it that way since Word 97 to avoid problems.)

Here is code to update all styles wiithout using the organizer or attaching the template.

Code:
Private Sub CopyNormalTemplateStylesVogelar()
   ' Copies styles from normal template
   ' 2019-12-01   Hans Vogelar
   ActiveDocument.CopyStylesFromTemplate (NormalTemplate.fullname)
End Sub

Private Sub CopyAllStylesGlobal()
    ' Copies all styles from Global Template - the template containing the macro
    ' 2020-01-12  Charles Kenyon
     ActiveDocument.CopyStylesFromTemplate (ThisDocument.fullname)
 End Sub
Macro to copy styles from one template to another - Microsoft Community

Both Graham Mayor and Greg Maxey have free utilities to batch process documents. Unless you are working on learning to code and enjoy it, you may want to use their utilities.

Here is the MVP article on batch processing. You seem to be following a similar path. How to Find & ReplaceAll on a batch of documents in the same folder by Ibby.

Last edited by Charles Kenyon; 10-27-2020 at 07:29 AM.
Reply With Quote