locked
When a Word template is attached from the network, a local copy appears and is attached instead RRS feed

  • Question

  • Hi,

    We attach a template to a document, prior to showing it to the user, like this:

    Word1.ActiveDocument.set_AttachedTemplate(TemplatePath);

    Lately, two Word 2010 clients have reported an error message from our VBA code.  This code verifies that the attached template is the one our database indicates should be used.

    What has happened is that Word (or Windows) has silently created a local copy, and attached that instead.  For example:

    C:\Users\username\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.MSO\12345678.dotm

    My question: under what circumstances is this done, and can one control it?

    Thanks,

    Art Gardner

    P.S. both customers have Word 14.0.7106.5003 (32 bit).

    Arthur Gardner


    • Moved by Cindy Meister MVP Friday, December 6, 2013 5:29 PM configuration, not developer related
    • Edited by Arthur Gardner Monday, December 9, 2013 2:16 PM
    Friday, December 6, 2013 4:09 PM

All replies

  • Hi Arthur

    I'd like to move your question to the TechNet IT Pro forum for Word as this is more likely something that can be answered by people who specialize in configuration. Is that OK for you?


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, December 6, 2013 4:54 PM
  • Sure, go ahead.

    Arthur Gardner

    Friday, December 6, 2013 5:11 PM
  • Hi Arthur,

    I am trying to involve someone familiar with this topic to further look at this issue. Appreciate your patience.

    Cheers,
    Tony Chen
    Forum Support
    ________________________________________
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please contact tnmff@microsoft.com.

    Wednesday, December 11, 2013 3:05 AM
  • Hello Arthur,

    I was reviewing your questions and need some information to proceed further -

    1) What is the error message from the VBA code ?

    2) You mentioned the build number it fails, which build it works / worked on ?

    Thanks, Pradeep Kumar R

    Tuesday, December 24, 2013 9:15 PM
  • 1) We compare a registry value in CURRENT_USER (local workstation, where Word, the document to which the template is attached, and our client code all reside) against the first attached template found in the Word model.  If they are not equal, we display our own error message, whose contents are therefore not relevant.

    2) We could not reproduce it with Word 14.0.6137.5000.


    Arthur Gardner


    Monday, January 6, 2014 4:13 PM
  • Thank you for your reply.

    I have further researched and found from my internal inquiries that there is an architectural change made in Office 2007 (and higher versions) to improve performance and responsiveness when working with network (UNC) files, especially over latent or slow networks.

    When Office opens an network (UNC) file the application downloads the entire file at once and then works against a local copy of the file. When the user saves the document the application copies the file back across the network.

    I am not sure why this is not happening on the build (14.0.6137.5000), however the behaviour is by design and it cannot be controlled.

    Thanks, Pradeep Kumar R

    Monday, January 6, 2014 9:56 PM
  • We are running Windows 7/Office 2010.

    I am having the same problem.

    We experience that when you save the document, the attached template in the document is changed to the temporary file. This disapper when you restart the computer.

    Our problem is that we have a toolbar that is supposed to be used on the document, if the user want to work on the saved document. Because the temporary file isnt there the toolbar dissapear.

    This worked fine om XP/Office 2007.

    Monday, May 19, 2014 6:23 AM
  • Given the relative cost of disk storage, a solution that gets around these is to store all the templates locally and update them upon network login from the server. Have users use the local templates, not those on the server.

    Charles Kenyon Madison, WI

    Tuesday, May 20, 2014 6:47 PM