+ Reply to Thread
Results 1 to 18 of 18

Saving Word Tempates to include Macro and Macro Shortcuts

  1. #1
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    402

    Saving Word Tempates to include Macro and Macro Shortcuts

    Hi guys,

    refer to the photo below.

    When I open my "Blank Formatted 20170816 v04.dotm" template document, it opens as "Document1"

    When I make changes to the "Document1" and Save As "Blank Formatted 20170816 v05.dotm", I lose all my macros, and I also lose all the assigned shortcuts to them.

    Is there a way I can retain my macros within my templates?


    Screen shot of opening "Blank Formatted 20170816 v04.dotm"
    Templates1.png


    Screen shot of opening "Blank Formatted 20170816 v05.dotm"
    Template 2.png




    Note: I am 90% sure I do not want to put the macros (and assign shortcuts) into "Normal.dotm" because then these macros will affect all documents in the future. I only want the macros and shortcuts to apply to this particular template.



    Thanks All,
    Jimmy

  2. #2
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    402

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    Hi guys,

    I just figured out I can drag and drop the module1 from "Blank Formatted 20170816 v04.dotm" into "Document1".
    However I still don't know how to retain the custom shortcuts to macros within "Document1" (so that they exist within "Blank Formatted 20170816 v05.dotm" when I save it).

    Thanks,
    Jimmy

  3. #3
    Forum Guru macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,695

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    Since the macros are in the template, simply making copy of the template will give you a copy of that with all the macros intact. Be that as it may, a document - even in the docx format - has full access to any macros in the template it was created from. Consequently, there is generally no need for the documents themselves to contain the macros.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  4. #4
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    402

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    Quote Originally Posted by macropod View Post
    Since the macros are in the template, simply making copy of the template will give you a copy of that with all the macros intact. Be that as it may, a document - even in the docx format - has full access to any macros in the template it was created from. Consequently, there is generally no need for the documents themselves to contain the macros.
    Hey macroGOD

    I'm working on multiple computers in multiple locations, moving around a lot. Its better for me if every word document is self contained with its own macros and shortcuts. Otherwise I ill have to copy and paste templates onto new computers and link it all up.


    Any ideas?
    Thanks

  5. #5
    Forum Guru macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,695

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    By far the simplest solution if you're on a network is to have the template in a folder where it can be accessed from anywhere on the network that needs access to it. Failing that, especially if you need to use multiple copies of the document, you could distribute the document with the template, keeping both in the same folder. Simply copying the macros from the template to the document(s) created from it won't reinstate any shortcuts.

  6. #6
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    402

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    Quote Originally Posted by macropod View Post
    By far the simplest solution if you're on a network is to have the template in a folder where it can be accessed from anywhere on the network that needs access to it. Failing that, especially if you need to use multiple copies of the document, you could distribute the document with the template, keeping both in the same folder. Simply copying the macros from the template to the document(s) created from it won't reinstate any shortcuts.
    My thinking is

    If the template changes /deleted / moved Or if the word document is moved onto a different computer, then the document no longer has any of its macros or shortcuts, which would be a pain.
    Thanks,

    JimmyWilliams

  7. #7
    Forum Guru macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,695

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    Quote Originally Posted by JimmyWilliams View Post
    If the template changes /deleted / moved Or if the word document is moved onto a different computer, then the document no longer has any of its macros or shortcuts, which would be a pain.
    A change that doesn't delete the macros from the template does not result in their loss for the documents concerned. Deleting the template, or moving the document to a different computer that lacks access to the template, would, however - which is why I suggested you might distribute them as a set if that is a concern.

    Another benefit to using a template is that, if you store it in a trusted location, Word will give access to its macros without the macro warning. That means you won't have to rely on users enabling the macros before they can be used.

  8. #8
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    402

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    Quote Originally Posted by macropod View Post
    or moving the document to a different computer that lacks access to the template, would, however - which is why I suggested you might distribute them as a set if that is a concern.
    ^^^ This is the case


    Is the solution to carry around both Document, and template. And then put the Template in the "%USERPROFILE%\AppData\Roaming\Microsoft\Templates" Area?

    Thanks Macro,
    Jimmy

  9. #9
    Forum Guru macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,695

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    As I have said a number of times now, if you store the template in the same folder as the document, that should address the issue. Simply make sure you either create the document from the template, then save it to that folder or, if you've already created the document, move the template to the document's folder then go to Developer|Document Template>Attach and re-attach the template from its new location. The two should then travel together satisfactorily.

  10. #10
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    402

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    If I have created Custom Tables of contents, and saved them as templates. (Or Created Custom Equations)
    See: Insert>Symbols>Equation>Save Selection to Equation Gallery....
    See: References>Table of Contents>Table of Contents> Save Selection to Table of Contents Gallery…


    Will these 'templates' be saved to my document or to the .dotm? (I'm assuming will be saved in the template .dotm)
    If I find the .dotm template file and move it, will it carry the "Created Custom Equations" or "created Custom Tables of contents"?

    If all of that is wrong, How do I retain these custom tables/equations?

    Thanks all,

    Jimmy

  11. #11
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    402

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    Quote Originally Posted by macropod View Post
    As I have said a number of times now, if you store the template in the same folder as the document, that should address the issue. Simply make sure you either create the document from the template, then save it to that folder or, if you've already created the document, move the template to the document's folder then go to Developer|Document Template>Attach and re-attach the template from its new location. The two should then travel together satisfactorily.
    OHHHHHHHHHHHH. That sounds cool, I'll have to look into it.

  12. #12
    Forum Guru macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,695

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    When you save a new equation to the gallery, it can only be saved to a template - you can choose which template to use. Hence, unless you saved it to your template and you distribute that template with the document (or otherwise make it available to all the documents based on it), those documents will not have access to your equation. The same applies to a custom Table of Contents.

  13. #13
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    402

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    I just got this message

    Untitled picture.png


    What the heck is a .dotx?
    Where the heck is a .dotx?

  14. #14
    Forum Guru macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,695

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    A dotx file is a template. Building Blocks.dotx is one of the built-in templates Word uses. The warning suggests that's where you stored your custom equation(s) & Table of Contents, instead of storing them in your own template.

  15. #15
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    402

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    Quote Originally Posted by macropod View Post
    A dotx file is a template. Building Blocks.dotx is one of the built-in templates Word uses. The warning suggests that's where you stored your custom equation(s) & Table of Contents, instead of storing them in your own template.
    With the "Normal.dotm" I'm able to get it back to normal by deleting it.
    Would the same thing would with the Building Blocks.dotx?

    And if so, where is the location of Building Blocks.dotx

  16. #16
    Forum Guru macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,695

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    Building Blocks.dotx is normally stored in:
    C:\Users\%Username%\AppData\Roaming\Microsoft\Document Building Blocks\1033\
    If you didn't save any changes to it, there's not much point messing with it and, if you did save the changes, you could simply undo those changes then re-save.

  17. #17
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    402

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    Thanks Macropod!

  18. #18
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    402

    Re: Saving Word Tempates to include Macro and Macro Shortcuts

    Quote Originally Posted by macropod View Post
    Building Blocks.dotx is normally stored in:
    C:\Users\%Username%\AppData\Roaming\Microsoft\Document Building Blocks\1033\
    If you didn't save any changes to it, there's not much point messing with it and, if you did save the changes, you could simply undo those changes then re-save.

    The solution is even easier.

    Edit existing Template Document:
    (Double clicking on a "Template.dotx" will open it up as a "Document 1.docx" that is based on the template)
    To make changes to a template do the following:
    Open Word Software > within Word Program Open up the template.dotx, this will open the document as the template and retain all the macro and building block changes.


    Jimmy

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 11-03-2014, 12:06 PM
  2. [SOLVED] Editing a Macro to include multiple rows and include text formatting for leading zeros
    By missmea2005 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-04-2014, 09:50 AM
  3. [SOLVED] Macro Saving WorkSheets as PDF’s –--Unable to Include Worksheet Name
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-31-2013, 12:11 PM
  4. How To Add Shortcuts To My Existing Macro
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-28-2009, 03:00 PM
  5. Macro shortcuts & VBA
    By kayard in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-14-2007, 11:11 AM
  6. Macro Shortcuts
    By Jzfromltown in forum Excel General
    Replies: 1
    Last Post: 12-12-2006, 05:09 PM
  7. Macro shortcuts
    By Don Wiss in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2006, 07:40 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1