Set a file template for a document or form library

When you create a document or form library, you can set a default file template for that library. This way, when someone creates a new file in the library, the default template opens in the appropriate program. For example in a document library, you can create a Microsoft Word template so that the next time you create a new file in that document library, the template opens in Word.

If you want to specify other settings or provide default content that appears in every new file, such as a preferred outline for a marketing campaign proposal or an official disclaimer in a page footer, you can also add this information to the template.

 Note    Setting up a template for a document or form library requires Full Control permission.

What do you want to do?


Learn about file templates in a document or form library

The types of files you can or cannot store in a SharePoint library

Depending on the file you have in a library, you might encounter one of the following situations:

Files compatible with SharePoint technologies    For a user to create a file by using the New command in a document library, the file template must be created from a program that is compatible with SharePoint, such as Microsoft Office Word. When you create a new file in a form library, the default program can be an XML-based form design program that is compatible with SharePoint, such as Microsoft InfoPath.

Other program files    For most other programs, you can still store and manage the file in the library. But instead of directly creating the file from the document library, you can create the file in your program and then upload it to the library later.

Blocked program files    For security reasons, some program file types, such as .exe, are blocked from being stored in a library.

The two types of libraries that use file templates

The two types of libraries that use templates are document and form libraries.

Document Libraries    You use a document library to store and manage many different file types, including documents, spreadsheets, presentations, text files, and other types of files. A document library is often the most common location on a site where you can create, collect, update, and manage files with team members and share with other colleagues throughout your business or enterprise. You can use a document library as a general-purpose file repository, or you can use it for a specific purpose. For example, a marketing team may have its own document library for planning materials, news releases, and publications.

Form Libraries    A form library provides a simple way for you to share and track XML-based forms that are used to gather information. For example, you can create a form library for your department’s expense report forms. The expense report form template is stored as the default file template in the form library. Each time someone creates an expense report, they open the template as a blank form, which contains the layout, fields, and calculations of the expense report. When someone fills out the form, the expense report data (and only the data) is saved as an XML file in the form library. By separating the data from the form, it’s much easier to process each expense report separately by other systems, merge the data, or export it for further processing and analysis.

Where the file templates are stored in the library

When a document or form library has a default file template, it is stored in the Forms folder of the library.

Open the library in File Explorer to see the Forms folder which contains the file template for the library.

The contents of the Folders folder in a document library

By default, a document library has a file template, called template.dotx, but you can change this file if you need to. To specify a different template, you need to first create it in a program that is compatible with SharePoint, such as Word, and then save it to the Forms folder of a library. Then, from the library, you specify the address of the custom template.

By default, a form library comes with a placeholder file, called template.xml that you must replace with a form template that you create.

Top of Page Top of Page

Creating a file template for a form library

To create or customize a template in a form library, you can use an XML-based form design program that is compatible with SharePoint, such as InfoPath. There can be additional advantages to using a form design program. For example, when you use InfoPath, you can do the following:

  • Create the form library and template directly from InfoPath.
  • Conveniently edit and re-publish the form template to the form library.
  • Merge the individual XML data files created from some form templates for further processing.
  • Promote the fields of XML data to library columns in the form library.

When a user creates a form, it opens by default in the form-editing program that is compatible with SharePoint on the user’s client computer. If no compatible program is installed, the form, if it is designed to open in the browser can open in the browser. If you want, you can specify that a form designed to open in a browser always opens in the browser. You can change the default behavior in the Opening Documents in the Browser setting in the advanced settings of the library.

Library Settings

Click the Library Settings command to get to Settings dialog

Screenshot of the settings page in a SharePoint Document Library

Settings for a document library

Screenshot of the Advanced Settings page for a Document Library in SharePoint

Open documents in browser setting

Top of Page Top of Page

Using content types to set up document or form library templates

If multiple content types are enabled and templates are specified for those content types, the library uses the templates that are specified by the content types, and not the default file template. In this case, if you want to customize the templates for the library, you must change the content types.

Set up a default file template when you create a document or form library

  1. Navigate to the site where you want to create the library.
  2. Click Settings, Settings: update your profile, install software and connect it to the cloud and click Add an App.
  3. Click either Document Library or Form Library.

     Note    The Form library template uses only Microsoft InfoPath as the default file format.

Document library    Form library                         

 Note    A site can be significantly modified in appearance and navigation. If you cannot locate an option, such as a command, button, or link, contact your administrator.

  1. Click Advanced Options.
  2. Enter a name, an optional description of the library, and choose whether SharePoint should create a version of files in the library each time they are edited.
  3. For a Document library, select the default application file format and version from the Document Template drop-down.

Select a template

 Note    The library name is required and appears at the top of the library page, becomes part of the address for the library page, and appears in navigational elements that help users to find and open the library.

To save the library as a template   

  1. Go to the library you just created.
  2. On the ribbon, select the Library tab, and in the Settings group, click Library Settings.
  3. Under Permissions and Management, click Save document library as template.
  4. Enter a file name and template name and description. If you want new libraries created from this template to include items in this template library, select the Include Content checkbox.

 Note    The extension you use for the filename in the File name field, determines the default file type for the template. The following file types are available by default:

  • Microsoft Word 97-2003 document
  • Microsoft Excel 97-2003 spreadsheet
  • Microsoft PowerPoint 97-2003 presentation
  • Microsoft Word document
  • Microsoft Excel spreadsheet
  • Microsoft PowerPoint presentation
  • Microsoft OneNote 2010 Notebook
  • Microsoft SharePoint Designer Web page
  • Basic page
  • Web Part page

Save a library as a template

  1. Click OK.

You can set the properties for the template library as you would any other library.

Top of Page Top of Page

Change the default file template for a document or form library

There are two ways you can change the default template:

  • If your document or form library has a default file template for a program compatible with SharePoint, then you can edit the default template.
  • For other programs, you cannot directly edit the default template, but you can copy a new template file to the Forms folder of the library to specify a custom template.

Edit the default file template

  1. Navigate to the site containing the library for which you want to edit the default template.
  2. Click the name of the library on the Quick Launch, or click Settings Settings: update your profile, install software and connect it to the cloud, click View Site Contents, and in the appropriate library section, click the name of the library.

     Note    You can modify a site’s appearance and navigation. If you cannot locate an option, such as a command, button, or link, contact your administrator.

  3. On the ribbon, click the Library tab, and in the Settings group, click Library Settings.
  4. Under General Settings, click Advanced settings.
  5. In the Document Template section, under the Template URL field, click Edit Template. One of the following happens:

     Note    If your site is a part of an Office365 subscription, then at this point, you may be asked to enter your Office365 subscription username and password.

  • Document library    The template opens in an application that is compatible with SharePoint and that is associated with the file type of the current template. For example, Word opens if the default template is a Word template, or Excel opens if the default template is an Excel worksheet.
  • Form library    The template opens either in a program compatible with SharePoint, either an XML-based form design program, such as InfoPath, or an XML editor.

Edit template

   
Edit the default library template

 Note    If people on your site already filled out forms that were based on the original template, consider how any changes to the template may affect those forms. For example, adding a field that users are required to fill out may cause errors to appear in the original forms that were filled out before the field was added.

  1. Make the changes that you want, and then save the template. Close the program if you no longer need it open, or switch to your site.
  2. Depending on your form design program, you may need to republish the template to the library on your site from your program.
  3. In your site, at the bottom of the Document or Form Library Advanced Settings page, and click OK.

Specify a custom file template

  1. Create and save your custom template in a program that is compatible with SharePoint. Make note of its location, and then switch to SharePoint.
  2. Navigate to the site containing the library for which you want to specify a custom template.
  3. Click the name of the library on the Quick Launch, or click Settings Settings: update your profile, install software and connect it to the cloud, click View Site Contents, and then in the appropriate library section, click the name of the library.

 Note    A site can be significantly modified in appearance and navigation. If you cannot locate an option, such as a command, button, or link, contact your administrator.

  1. On the ribbon, click the Library tab, and then in the Connect & Export group, click Open with Explorer.

 Important    If File Explorer does not open or you see an error message, you may have to add your site as a Trusted site in your browser settings. For more information, see the topic How to use the "Open with Explorer" command and how to troubleshoot issues with this option in SharePoint Online for Office 365.

  1. In File Explorer, browse to find the custom template that you created.
  2. Right-click the file, and then click Copy on the shortcut menu.
  3. Click the Back button until you return to the library, and then click the Forms folder to open it.
  4. Right-click in a blank area in the folder window, and then click Paste on the shortcut menu.
  5. Close File Explorer and return to the library on the site.
  6. On the ribbon, in the Settings group, click Library Settings.
  7. Under General Settings, click Advanced settings.
  8. In the Document Template section, do one of the following:

Document library    Type the address of your custom template in the Template URL box. The location is the Web address of the template on the site, relative to the name of the site. For example, if your template is called Watermark.dotx, and you add it to the Forms folder of the Shared Documents, document library, you would type the following:

Shared Documents/Forms/Watermark.dotx

Form Library    Type the address of the custom template that you want to use in the Template URL box. The location is the Web address of the template on the site, relative to the name of the site. For example, if your template is called Orders.xml, and you add it to the Forms folder of the Purchases form library, you would type the following:

Purchases/Forms/Orders.xsn

 Note    If the settings in the Document Template box are not available, an administrator may have set up multiple content types. To see whether multiple content types are enabled, verify that Yes is selected under Allow management of content types? in the Content Types section immediately above the Document Templates section. If it is, you must edit the template for the content type.

Top of Page Top of Page

 
 
Applies to:
SharePoint Foundation 2013, SharePoint Online Enterprise (E1), SharePoint Online Enterprise (E3 & E4), SharePoint Online operated by 21Vianet - Enterprise (E1 & E2), SharePoint Online operated by 21Vianet - Enterprise (E3 & E4), SharePoint Online operated by 21Vianet - Small Business, SharePoint Online Small Business, SharePoint Server 2013 Enterprise, SharePoint Server 2013 Standard