Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Error 5180 Word Cannot open document template

Posted on 2016-10-13
1
Medium Priority
?
57 Views
Last Modified: 2016-10-30
I use a macro to change a template.  This allows me to quickly hide certain styles containing information that my target audience does not need to see, without changing the actual contents of the document (I have another macro to change it back).  It works fine, and looks something like this:
    With ActiveDocument
        .UpdateStylesOnOpen = True
        .AttachedTemplate = "Comments"
    End With
My problem is that, using Word 2013, it complains that the macro is not located in my 'Documents' directory.  If I move the .doc file to the Documents directory it works properly, but I do not want my Documents directory cluttered up with a bunch of .dot(m) files. That, I assume, is partly why older versions of Word used a Templates directory.

I looked at another page and followed instructions to tell Word (using Windows 7, in my case) where such a directory would be [ File > Options > Save, and then put the address into the 'Default personal templates' location box], but that doesn't seem to work.

How can I get Word, and hopefully other Office programs, to look in the right place for templates?
0
Comment
Question by:Alan Humm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 22

Accepted Solution

by:
crystal (strive4peace) - Microsoft MVP, Access earned 2000 total points
ID: 41842547
you can customize the Word Options:
File, Options, Save -- and specify the path for "Default personal templates location"
 Word Options, Save locationsIf the template runs code, you probably also have to allow code to run for that location:
File, Options. Trust Center, click "Trust Center Settings..."
Word Options, Trust Centerand then add the location in Trusted Locations Word Options, TrustedLocations since I am a programmer, I trust all my drives at the root.  I also allow trusted locations on my network.
1

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question