Customize “New” tab in Word backstage to add custo

2019-06-08 19:55发布

问题:

I want customize Word's backstage to add custom templates in "New" tab and not another.
Templates come from a web service. I use Office 2010. Application is develop in C# with Visual Studio 2010.

Is it possible?

回答1:

You can add custom templates to the New tab of Word's backstage view by providing an XML manifest, which describes the template and the location of a preview image.

The detailed steps are described here:

Deploy custom templates in the 2007 Office system

Be aware though that this is a rarely used feature and therefore is rather poorly supported. For example, I found the following shortcomings:

  • When opening the folder with the custom templates the first time, the view is empty. The second time you access the backstage view, the templates are shown.
  • Preview and thumbnail images are cached locally. However, I never found a way to update the local cache (the location of the cache is %LOCALAPPDATA%\Microsoft\Office\Spotlight\14, replace 14 with whatever your Office version is). When manually deleting the cache, you will also have to delete the following Registry key: HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\Spotlight\Content\<provider name> (replace 14 with whatever your Office version is).


回答2:

See Word 2013: Templates location and File/New.

The Backstage UI extensibility model doesn't provide anything for templates. You need to place your custom template into presonal temaplates folder and then a user will be able to see them.

Also, as a workaround, you may add a custom tab on the Backstage with your own templates (controls) that come from a web service. You can read more about the Backstage UI in the following articles in MSDN:

  • Introduction to the Office 2010 Backstage View for Developers
  • Customizing the Office 2010 Backstage View for Developers