I’m struggling with a macro (based on Charles Kenyon’s example on his website) to copy styles from my global template to documents created by the user. The macro will be started by an event handler in the global template.
To speed things up I want to copy only the custom styles I have made; I believe I can locate them by parsing the style name to identify a prefix I use in custome style names. I attempted to step through all the styles with “for each <style> in <global template.styles>” so I could examine each one for the prefix, and then copy it.
The problem is that the compiler won’t accept “for each <style> in <global template.styles>” presumably because the global template is not active.
I’d like to avoid a hard-coded number in “for <count> 1 = <total number of custom styles> so that the macro doesn’t need updating if new styles are added.
I’d be grateful for any suggestions! Or, being told that this is one more Word impossibility...![]()


As it is, I’ve got the macro working; it loads the styles into any document created with a template having the company’s prefix.

