Creating Word Templates using VSTO RRS feed

  • Question

  • We have a number of VBA templates in Word 2003 which all include styles and autotext.  When a template is created in VSTO can styles, autotext and toolbars be created in it?  My other question is can documents created using the VBA Word templates be attached to the newer VSTO versions? 

    I understand the benefits of using VSTO to redo some things that are currently in VBA but would appreciate understanding the benefits of or the need to redo VBA Word templates in VSTO.


    Monday, February 27, 2006 12:34 AM


  • In general, you can create and store styles, autotext, and toolbars with a VSTO enabled template and have them travel with the template and documents created based on the template.

    As for the second question, just to clarify, you are asking about the ability under the Tools -> Templates & Add-Ins menu item to add Global templates and Add-Ins, correct?  If so then adding a VSTO enabled template via this mechanism does not attach the VSTO customization to the existing document.  Only documents created from the customized template inherit the customization. 

    If you would like to attach a customization to an existing document, you may want to consider using the ServerDocument class in the VSTO runtime.  This class has methods that you can call that can attach customizations to existing documents.

    Wednesday, March 1, 2006 3:09 AM