none
Path to document template for shared documents

    Question

  • Our users create documents that are created from templates and are later shared with a second user. The second user has to use VBA code in the template in order to continue.

    What should happen is that when I save a document using this template:

    C:\Documents and Settings\ENJEO\Application Data\Microsoft\Word\Startup Support Files\building.dotm

    ...the second user should open the document and the path to the template should be:

    C:\Documents and Settings\PLNXE\Application Data\Microsoft\Word\Startup Support Files\building.dotm

    That is, it should find the same template in the second user's templates folder. Sometimes this happens, but sometimes the path to the template remains with ENJEO in the path, in which case the second user doesn't have access to the VBA code in building.dotm (because that path does not exist on their machine).

    Can anyone explain why this is, and how to always get Word to always exchange ENJEO with PLNXE when the second user opens the document?

    Thanks

    Thursday, November 29, 2012 5:00 PM

All replies

  • If the code should be available to all documents, you could put it in a global template that you place in the Startup folder (for each user).

    Stefan Blom, Microsoft Word MVP
    Thursday, November 29, 2012 6:48 PM
  • Thanks for you response, Stefan. We have a complex template architecture and it is not within scope to change it as you suggest. However, my question is, why does Word sometimes change ENJEO to PLNXE and sometimes not? It sometimes updates the path to the template for the document when PLNXE opens it. How can I make Word do that all the time?

    Thursday, November 29, 2012 7:15 PM
  • "JimOL" wrote in message news:8db5dd72-e1f1-431d-b09c-51af21575a30@communitybridge.codeplex.com...
    Thanks for you response, Stefan. We have a complex template architecture and it is not within scope to change it as you suggest. However, my question is, why does Word sometimes change ENJEO to PLNXE and sometimes not? It sometimes updates the path to the template for the document when PLNXE opens it. How can I make Word do that all the time?

     
    As far as I know, you can’t (but I could be wrong). The only way for a Word document to find its template (without a full path) is if both the document and the template are in the same folder.
     
    See if Using Developer in Word to make templates with multiple options (in the Word for Developers forum at MSDN) helps at all.

    Stefan Blom, Microsoft Word MVP
    Thursday, November 29, 2012 7:42 PM
  • Hi Jim,

    I'm a little confused, if any user open the document should be able to find the building.dotm template in their starup folder, why not just put the the building.dotm into the users' startup folder who need to edit the document?

    Or another method:

    How about keep the VBA code inside the document, that means to save the document with the Macro-enabled document.


    Max Meng
    TechNet Community Support

    Tuesday, December 04, 2012 1:43 PM
    Moderator