Originally Posted by Howard Kaikow
I have done steps 1 and 2, and part of 3, i.e., I've put on sweatsocks and exercise shoes.
I added a link at the original URL to a 2nd .zip file that greatly simplifies the code and helps isolate what may be the problem.
A common sub is used for all processing. The only difference is whether it is passed MacroContainer or NormalTemplate.
So far, the code seems to work as desired using MacroContainer, but not with NormalTemplate.
I have not yet investigated whether it would make any difference if the code were put in the NormalTemplate, in which case, there should be no difference between using MacroContainer or NormalTemplate for those cases in which I want the toolbar in the Normal Template. I would rarely desire this as I run with Normal template as read-only except when I need to do some testing or modifications. Anyway, application specific stuff should be in app specific templates.
Running in Word 2003, the current code seems to work for MacroContainer, but not for NormalTemplate.
Ditto for Word 97 and Word 2000.
For Word 97, I had to add error handling in the output sub because it didn't like the Parent property, I've not investigated why.
For Word 2000, I had to run a few times before the case using NormalTemplate failed. Similar to what I found 3+ years ago.
Did not bother to try in Word 2002.
Further pounding will determine whether the MacroContainer case really works.
Obviously, there's an oddity with NormalTemplate as the problem does not surface immediately in Word 2000, but does in other versions.
I'm not sure what can be done to further simplify the code, remembering that CustomizationContext must be used.
I started to fool around with using OpenAsDocument, instead of using CustomizationContext, but that seemed to always store the toolbar in the NormalTemplate.