Word Macro's in templates
Currently we have code that works perfectly when opening the document up. The sub procedure "AutoOpen()" placed in the "ThisDocument" module of the Word Objects part of the project runs and will open a userform. That userform, then uses the ThisDocument command to change the picture of an image control within the document called "imgSpace", using the following code:
ThisDocument.imgSpace.Picture = LoadPicture(ImagePath)
This all works fine....that is until the document is then converted to a template. When it is a template, it creates a copy of itself (with references to the original template code), the autoopen() procedure will not run and the references to ThisDocument.imgSpace no longer work.
How can i convert the code to automatically run when the template is opened...and only this template (so not global), and also refer to the control "imgSpace" within the new document based on the template.
Hope this all makes sense, and thank you in advance.