locked
Add Template as Button on Custom Ribbon (VBA) RRS feed

  • Question

  • I have been able to find information on doing this in Outlook for e-mail templates but I haven't found anything regarding Word 2010. I have quite a few Word 2010 templates *.dotm that I would like to add to a custom ribbon tab for my employees. I know that I can add the "New Document or Template..." button to my ribbon but it brings up the whole template dialog box with extra templates and even when I remove those, if a user selects one from the new menu, it gets added here. I also couldn't find a way to remove the normal.dotm and xml document templates here which might confuse people.

    Ideally I would like to create a macro/vb macro that I can set to automatically open a template. I can then add that macro to my ribbon so it only takes 1 click to start a new document from that template. If I can put the templates in a network location and reference them so that they can be easily updated that would be ideal as well but not required. 

    Any help or advice is greatly appreciated.

    Wednesday, October 24, 2012 11:28 PM

Answers

  • Hi,

    You can try the Documents.Add Method.

    For example:

    Sub automateword()
    
    Documents.Add Template:="C:\Program Files\Microsoft Office" _
     & "\Templates\Memos\Professional Memo.dot"
    
    End Sub

    More information:

    http://msdn.microsoft.com/en-us/library/office/ff845011.aspx

    Best regards,


    Rex Zhang

    TechNet Community Support

    • Marked as answer by Tmark86 Friday, October 26, 2012 5:00 PM
    Friday, October 26, 2012 6:12 AM

All replies

  • Hi,

    You can try the Documents.Add Method.

    For example:

    Sub automateword()
    
    Documents.Add Template:="C:\Program Files\Microsoft Office" _
     & "\Templates\Memos\Professional Memo.dot"
    
    End Sub

    More information:

    http://msdn.microsoft.com/en-us/library/office/ff845011.aspx

    Best regards,


    Rex Zhang

    TechNet Community Support

    • Marked as answer by Tmark86 Friday, October 26, 2012 5:00 PM
    Friday, October 26, 2012 6:12 AM
  • Thanks Rex,

    That was exactly what I was looking for. I had to play with the location a little bit but I got it to work exactly how I was thinking.

    The only other thing that would be nice is to have the ability to easily add custom ribbon images for the macros on everyone's ribbons but I looked into and the customization gets to detailed for simple solution I am going for. Not the end of the world.

    Thanks again,

    TMark86

    Friday, October 26, 2012 5:01 PM