• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

4.1. Working with Templates

All Writer documents are based on templates. If you don't specify a template when you start a new document, the document is based on the default template for text documents. If you have not specified a default, Writer uses the blank template that is installed with the program.

Templates have a file extension of .stw. Documents have a file extension of .sxw.

4.1.1. Create a New Template

To create a new template:

  1. Create a new document, open an existing document, or open an existing template. You can:

    • Set up your styles for pages, paragraphs, characters, frames, and numbering, as described in "Working with Styles" in section 4.2.

    • Specify a default printer for documents based on this template, as described in "Define a Default Printer for a Template" in section 4.1.3.

    • Set up user options such as the language and measurement units, as described in Chapter 1.

  2. Click File > Templates > Save.


    Do not use File > Save As > Template for the reasons discussed below in "Making your templates sticky."

  3. In the Templates dialog (Figure 4-1), type a name for the new template, navigate to the required folder in the Categories list, then click OK.

    Figure 4-1. Saving a file as a new template Making your templates sticky

File > Templates > Save creates a template with slightly different characteristics from templates created with File > Save As > Template.

Any document based on a template created using File > Templates > Save will retain an association with the template. I call these "sticky" templates. If you change a sticky template, then the next time you open any document based on that template, you will receive a message that your styles don't match the template, and you can choose to update the document's styles from the template.

If you want your documents to always reflect the latest changes to a template, be sure to save the template this way. Large projects, including master documents (described in "Creating and Using Master Documents" in section 7.4) and projects with more than one writer, typically make extensive use of templates in this way.

Any document based on a template created using File > Save As > Template will not retain any association with the template. Therefore, if you change the template, then the next time you open the document, you will not be asked if you want to update the document's styles. You might not want letters that are produced, sent, and then archived to retain an association with the template. How to tell if a template is sticky

Both types of template have the same file extension, and both otherwise behave the same. The only way to tell if a template is sticky is to create a new document from the template and look in the document's properties to see if the template is listed there, as described in "Determine Which Template is Associated with a Document" in section 4.1.8.

4.1.2. Import a Template

You can change a non-sticky template into a sticky template by importing it. You might wish to do this if, for example, you saved the template incorrectly the first time, or you downloaded a template from someone else. To import a template:

  1. Click File > Templates > Organize.

  2. On the Template Management dialog (Figure 4-2), select a folder in the Templates list, and then click the Commands button and select Import Template.

  3. The usual browse dialog opens. Find and select the template you want to import, and then click Open. The imported template is now listed in the selected folder in the Template Management dialog, and it has the "sticky" characteristics.

  4. Click Close.

Figure 4-2. Importing a template

4.1.3. Define a Default Printer for a Template

  1. Click File > Templates > Organize.

  2. On the Template Management dialog, select a template, and then click the Commands button and click Printer Settings.

  3. On the Printer Setup dialog (Figure 4-3), select the printer, and then click OK.

  4. Click Close on the Template Management dialog.

Figure 4-3. Choosing a default printer

4.1.4. Specify Which Template Is the Default for Text Documents

The default template is applied when you click File > New > Text Document or longclick the New icon on the function bar and click Text Document.

You can specify any template to be the default template, and you can change the default at any time. Any change will apply to documents created after the change; it has no effect on existing documents. To specify a default template:

  1. If the Template Management dialog is not open, click File > Templates > Organize.

  2. In the Template Management dialog, select a template, and then click the Commands button and select Set as default template. Click Close.

4.1.5. Change the Information in an Existing Template

You cannot save changes to a template from within a document. Instead, you need to edit the template directly, or use the Template Management dialog to copy styles from one template to another, as described in "Copy Information Between Templates" in section 4.1.6. To edit the template directly:

  1. Click File > Templates > Edit. Navigate to the folder containing the required template and open the template from there.

  2. Make your changes, then click File > Save (or click the Save icon, or press Ctrl+S). Do not use File > Templates > Save because this will create a new template based on the one you've just changed.

4.1.6. Copy Information Between Templates

If you have styles in one template that you want to use in another template, you can copy them from one to the other.

  1. Click File > Templates > Organize.

  2. In the Template Management dialog (Figure 4-4), set both lists to Templates. Open the folders and find the templates from and to which you want to copy.

  3. Double-click on the template name and then the Styles icon to show the list of individual styles.

  4. To copy a style from the template on the left to the template on the right, hold down the Ctrl key and drag the name of the style from the left template to the right template. (If you drag a style name without holding down the Ctrl key, the style will be moved, not copied; that is, it will be deleted from the template you are dragging it from.)

  5. Repeat for each style you want to copy. When you are finished, click Close.

Figure 4-4. Copying styles from one template to another

4.1.7. Create a New Document from a Template

To start a new document from the default template, click File > New > Text Document. The new document opens in the Writer window.

To start a new document from any other template:

  1. Click File > New > Templates and Documents.

  2. On the Templates and Documents dialog (Figure 4-5), you can display either the document properties for the template or a preview of the first page of the template by selecting one of the icons at the top of the right-hand pane. Select the required template, and then click Open.

    If you cannot see the required template, you may need to use the navigation icons above the Title pane to locate it. It may be in a different folder.

4.1.8. Determine Which Template is Associated with a Document

To determine which template is associated with a document:

  1. Open the document in Writer.

  2. Click the Files > Properties > General tab. The associated template (if any) is shown near the bottom of the page.

Figure 4-5. Creating a new document from a template

4.1.9. Apply a Different Template to a Document

You cannot apply a different template to an existing document in Writer as you can in Microsoft Word. Here is how to do it in Writer:

  1. Start a new document based on the new template, using File > New > Templates and Documents.

  2. Delete any text that may be in this new document.

  3. Copy the contents of the old document into the new blank document and save it under a new name.

  4. Rename the old and new documents if necessary.

4.1.10. Copy Styles from a Template into a Document

You can use Format > Styles > Load to copy the styles from a template into a document. This does not associate the new template with the document, so any changes you make to the template will not be reflected in the document unless you go through the process again.

  1. Open the document you want to copy styles into.

  2. Click Format > Styles > Load.

  3. On the Load Styles dialog (Figure 4-6), find and select the template you want to copy styles from. Select the checkboxes for the categories of styles to be copied. Select Overwrite if you want the styles being copied to replace any styles of the same names in the document you're copying them into. Click OK.

Figure 4-6. Copying styles from a template into the open document

4.1.11. Find Where Your Templates Are Stored

The location of the folders for templates may vary depending on your computer's operating system, whether you are on a network, and other factors.

The easiest way to find out where your templates are stored is to click Tools > Options > OpenOffice.org > Paths and look down the list for Templates. The entry will show the paths to both the shared templates and your personal set of templates. Typically, these paths will be ..\share\template for the shared templates (which may be on a network) and ..\user\template for your personal templates (under wherever OpenOffice.org is located on your computer).

You or your network administrator can change these paths and store templates wherever you wish. You can also make any subfolders you want to organize your templates.

Make sure any templates used in shared documents are available to all members of your workgroup—for example, by storing them on a LAN server.

If everyone does not have access to the same templates (for example, not everyone is connected to the LAN all the time, perhaps because they are working from home), some people may need to keep a copy of the templates on their own computers. In that case, make sure the copies are read-only, or you'll end up with a collection of slightly different templates.


You can store templates in other folders. They won't show up in the Templates and Documents dialog, but you can still use them to create new documents.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint