A family of Microsoft word processing software products for creating web, email, and print documents.
We have a macro-enabled template on our server that is being used as the base for a company form. I finally got everything working correctly with new documents created from the template (thanks Jay and Doug!) but we have a handful of old documents from before I got it working correctly that have old code embedded in them or are otherwise not linked to the template correctly.
I've been trying to figure out how to link an existing document to the macros in the template but I can't seem to figure it out nor find it on Google. If I open the template and the document together in the VB editor I can drag the template project onto the document project in the project explorer and the template is added to the references for the document. However, the macros don't run, and the reference disappears when the document is saved and closed.
If I go to Tools -> References and add the template document, it shows up in the project explorer, but I can't open the template ("project is unviewable") and again the macros don't work and the reference isn't saved with the document.
I'm stuck. Any tips? Thanks in advance.
With the document open in Word (not the Visual Basic Editor), go to the Developer tab and then click on Document Template in the Templates section of the Ribbon and then click on the Attach... button and navigate to and select the desired template. After doing that and clicking on OK, the macros in the template will be available for use in the document.