none
Problem Using CopyStyles From Template Normal.dotm RRS feed

  • Question

  • For the normal template the default location is - C:\Users\myUserName\AppData\Roaming\Microsoft\Templates...but we have redirected it to a server path of \\file\home$\Office2010Test\Application Data\Microsoft\Templates. We are running this over citrix with Windows 2003 server.

    I am using this code to copy styles from the Normal.dotm to the document - ActiveDocument.CopyStylesFromTemplate NormalTemplate.FullName

    Now the problem I have is when I set the normal.dotm template path to - \\file\home$\Office2010Test\Application Data\Microsoft\Templates and I get a message displaying the Normal.dotm is locked for editing by "username". The strange thing is when I point the Normal.dotm location to  C:\Users\myUserName\AppData\Roaming\Microsoft\Templates it works perfectly and does not display this message.

    I have stepped through the code to ensure that the NormalTemplate.FullName path is correct which it is, so Im unsure what could be causing this to occur.

    I have also added the two locations as trusted locations.


    Any help would be very greatly appreciated.

    Louis

    Friday, July 6, 2012 3:30 PM

All replies

  • Hi LCJ187,

    Thank you for posting in the MSDN Forum.

    You need to contact the administrator of that server, for it seems that your problem is you don't have the authority to access the template.

    Best regards,
    Quist

    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Quist ZhangModerator Thursday, July 19, 2012 8:11 AM
    • Unmarked as answer by LCJ187 Tuesday, August 14, 2012 9:04 AM
    Tuesday, July 10, 2012 7:50 AM
    Moderator
  • We have checked the permissions and the user permissions are fine. It seems to be a problem with having the normal.dotm in any other location other than C:\Users\myUserName\AppData\Roaming\Microsoft\Templates

    Does anyone have any other suggestions?

    Louis

    Tuesday, August 14, 2012 9:08 AM
  • Hi Louis

    <<Does anyone have any other suggestions?>>

    Have you checked with the IT Pros in the Technet forum?
    http://social.technet.microsoft.com/Forums/en-US/word/threads

    That would probably be the best place to get ideas for solving problems involved with files (especially templates) saved in a network location. Be sure to specify the version of Word involved with the problem. I know there have been issues with 2010, for example...


    Cindy Meister, VSTO/Word MVP

    Monday, August 20, 2012 12:15 PM
    Moderator
  • Based on my experience in Citrix and MS Office templates this is going to be a tricky.

    Have you tried to open the template as read-only and copy styles across

    Or try to create a document based on Normal.dotm, hide it, copy styles and kill this document

    What happens when you execute the code? Does your code throw any error message or simply ignores the path?

    And how about this code line Documents("<your doc name>").CopyStylesFrom Template:= "<path>"

    Thanks.


    Hope this helps!! Regards, Pranav Vaidya PS: If my reply has resolved the issue you are facing please mark it as answer so that it will help others on the forum who may have similar issue.

    Wednesday, August 22, 2012 2:37 PM