Difference between revisions of "Documentation/OOoAuthors User Manual/Writer Guide/Working with Templates"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Introduction)
m (interwiki link added)
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{NeedsWork}}
+
{{DISPLAYTITLE:Working with Templates}}
This page was created by converting ODT to Mediawiki using Writer2MediaWiki.
+
[[de:DE/Dokumentation/OOo_2.x/Handb%C3%BCcher/Writer-Handbuch/Die_Verwendung_von_Dokumentvorlagen]]
 +
{{WriterTemplatesTOC|ShowPrevNext=block
 +
|PrevPage=Documentation/OOoAuthors User Manual/Writer Guide/Using spreadsheet functions in a table
 +
|NextPage=Documentation/OOoAuthors_User_Manual/Writer Guide/Using a template to create a document}}__notoc__
  
 
This is Chapter '''10''' of the '''OpenOffice.org 2.x Writer Guide''' (Third edition), produced by the [http://oooauthors.org/ OOoAuthors group]. A PDF of this chapter is available from the [http://documentation.openoffice.org/manuals/oooauthors2/ OOoAuthors Guides page] at OpenOffice.org.
 
This is Chapter '''10''' of the '''OpenOffice.org 2.x Writer Guide''' (Third edition), produced by the [http://oooauthors.org/ OOoAuthors group]. A PDF of this chapter is available from the [http://documentation.openoffice.org/manuals/oooauthors2/ OOoAuthors Guides page] at OpenOffice.org.
  
[[User_Manuals| &lt;&lt; User Manuals page]]<br>
+
== Introduction ==
[[Writer Guide| &lt;&lt; Writer Guide Table of Contents]]<br>
+
[[Writer Guide/Working with Tables| &lt;&lt; Chapter 9 Working with Tables]] &nbsp;&nbsp;|
+
&nbsp;&nbsp;[[Writer Guide/Using Mail Merge| Chapter 11 Using Mail Merge &gt;&gt;]]
+
 
+
 
+
= Introduction =
+
 
{{:What is a template}}
 
{{:What is a template}}
 
See [[#Setting a default template|Setting a default template]] for more information.
 
See [[#Setting a default template|Setting a default template]] for more information.
Line 16: Line 13:
 
This chapter shows you how to:
 
This chapter shows you how to:
  
* [[#Using a template to create a document|Use a template to create a document]].
+
* [[Documentation/OOoAuthors User Manual/Writer Guide/Using a template to create a document|Use a template to create a document]].
* [[#Creating a template|Create a template]].
+
* [[Documentation/OOoAuthors User Manual/Writer Guide/Creating a template|Create a template]].
* [[#Editing a template|Edit a template]].
+
* [[Documentation/OOoAuthors User Manual/Writer Guide/Editing a template|Edit a template]].
* [[#Setting a default template|Set a default template]].
+
* [[Documentation/OOoAuthors User Manual/Writer Guide/Setting a default template|Set a default template]].
* [[#Organizing templates|Organize templates]].
+
* [[Documentation/OOoAuthors User Manual/Writer Guide/Organizing templates|Organize templates]].
 
+
= Using a template to create a document =
+
To use a template to create a document:
+
 
+
# From the main menu, choose '''File > New > Templates and Documents. '''The Templates and Documents dialog box opens. (See Figure 1.)
+
 
+
# In the box on the left, click the '''Templates '''icon if it is not already selected. A list of template folders appears in the center box.
+
# Double-click the folder that contains the template that you want to use. A list of all the templates contained in that folder appears in the center box.
+
# Click the template that you want to use. You can preview the selected template or view the template’s properties:
+
 
+
* To preview the template, click the '''Preview''' icon. (For the location of the Preview icon, see Figure 1.) A preview of the template appears in the box on the right.
+
* To view the template’s properties, click the '''Document Properties''' icon. (For the location of the Document Properties icon, see Figure 1.) The template’s properties appear in the box on the right.
+
 
+
# Click '''Open.''' The Templates and Documents dialog box closes and a new document based on the selected template opens in Writer. You can then edit and save the new document just as you would any other document.
+
 
+
<center>[[Image:|thumb|<center></center> <center>''Figure 1. Templates and Documents window''</center>]]</center>
+
 
+
= Creating a template =
+
You can create your own templates in two ways:
+
 
+
* From a document
+
* Using a wizard
+
 
+
== Creating a template from a document ==
+
To create a template from a document:
+
 
+
# Open a new or existing document you want to make into a template.
+
# Add the content and styles that you want.
+
# From the main menu, choose '''File > Templates > Save. '''The Templates dialog box opens (see Figure 2).
+
 
+
# In the '''New template '''field, type a name for the new template.
+
# In the '''Categories''' list box, click the category to which you want to assign the template. (The category is simply the template folder in which you want to save the template. For example, to save the template in the “My Templates” folder, click the '''My Templates '''category.)<br/> To learn more about template folders, see “[[#Organizing templates|Organizing templates]]” on page [[#Organizing templates|8]].
+
# Click '''OK. '''Writer saves the new template and the Templates dialog box closes.
+
 
+
 
+
{| class="prettytable"
+
| [[Image:]]
+
| OOo 1.X previously used a “Default” folder in place of the new “My Templates” folder.
+
 
+
|}
+
<center>[[Image:|thumb|<center></center> <center>''Figure 2. Saving a new template''</center>]]</center>
+
 
+
Any settings that can be added to or modified in a document can be saved in a template. For example, below are some of the settings (although not exhaustive) that can be included in a Writer document and then saved as a template for later use:
+
 
+
* Printer settings: which printer, single-sided or double-sided, paper size, etc.
+
* Styles to be used, including character, page, frame, numbering, and paragraph styles.
+
* Format and settings regarding indexes, tables, bibliographies, table of contents.
+
 
+
== Creating a template using a wizard ==
+
You can use wizards to create these types of Writer templates:
+
 
+
* Letter
+
* Fax
+
* Agenda
+
 
+
For example, the Fax Wizard steps you through the following choices:
+
 
+
* Type of fax (business or personal)
+
* Document elements like the date, subject line (business fax), salutation, and complimentary close
+
* Options for sender and recipient information (business fax)
+
* Text to include in the footer (business fax)
+
 
+
To create a template using a wizard:
+
 
+
# From the main menu, choose '''File > Wizards''' >''' '''type of template required (Figure 3).
+
 
+
<center>[[Image:|thumb|<center></center> <center>''Figure 3: Creating a template using a wizard''</center>]]</center>
+
 
+
# Follow the instructions on the pages of the wizard. This process is slightly different for each type of template, but the format is similar for all of them.
+
# In the last section of the wizard, you can specify the name and location for saving the template. The default location is your user templates directory, but you can choose a different location if you prefer.
+
# Finally, you have the option of creating a new document from your template immediately, or manually changing the template. For future documents, you can re-use the template created by the wizard, just as you would use any other template.
+
 
+
= Editing a template =
+
You can edit a template’s styles and content, and then, if you wish, you can reapply the template’s styles to documents that were created from that template.
+
 
+
 
+
{| class="prettytable"
+
| <center>'''Note'''</center>
+
| You can only reapply styles. You cannot reapply content.
+
 
+
|}
+
To edit a template:
+
 
+
# From the main menu, choose '''File > Templates > Organize. '''The Template Management window opens (see Figure 4).
+
 
+
<center>[[Image:|thumb|<center></center> <center>''Figure 4. Template management window''</center>]]</center>
+
 
+
# In the box on the left, double-click the folder containing the template that you want to edit. A list of all the templates contained in that folder appears underneath the folder name.
+
# Click the template that you want to edit.
+
# Click the '''Commands '''button.
+
# From the drop-down menu, choose '''Edit. '''The Template Management window closes and the selected template opens in Writer.
+
# Edit the template just as you would any other document. To save your changes, choose '''File > Save '''from the main menu.
+
 
+
The next time that you open a document that was created from the changed template, the following message appears.
+
 
+
<center>[[Image:|thumb|<center></center> <center>''Figure 5. Apply current styles message ''</center>]]</center>
+
 
+
Click '''Yes '''to apply the template’s changed styles to the document. Click '''No '''if you do not want to apply the template’s changed styles to the document. Whichever option you choose, the message box closes and the document opens in Writer.
+
 
+
 
+
{| class="prettytable"
+
| '''Note'''
+
| Automatic updating from a template did not work in OOo2.0.2. This bug was fixed in OOo 2.0.3. To re-enable updating in files created using OOo 2.0.2:
+
 
+
# Use '''Tools > Macros > Organize Macros > OpenOffice.org Basic'''. Select the document from the list, click the +, and select Standard. If Standard has a + beside it, click that and select a module.
+
# Name the macro. For example, you could call it FixDocument. If the '''Edit''' button is active, click it. If the Edit button is not active, click '''New''', type a module name in the pop-up dialog, and click '''OK'''.
+
# In the Basic window, enter the following:
+
 
+
Sub FixDocument
+
+
TemplateName = ThisComponent.DocumentInfo.Template
+
+
  <nowiki>if TemplateName <> "" then</nowiki>
+
+
  ThisComponent.DocumentInfo.Template = TemplateName
+
+
  end if
+
+
End Sub
+
 
+
# Click the '''Run BASIC''' icon, then close the Basic window.
+
# Save the document.
+
 
+
Next time when you open this document you will have the update from template feature back.
+
 
+
|}
+
= Adding templates with Extension Manager =
+
A new feature in OOo 2.0.4 was the Package Manager, called the Extension Manager in OOo 2.1. This feature provides an easy way to install collections of templates, graphics, macros, or other add-ins that have been “packaged” into files with a .OXT extension.
+
 
+
# After you download a package, select '''Tools > Extension Manager''' from the menu bar. In the Extension Manager dialog (Figure 6), click '''Add'''.
+
 
+
<center>[[Image:|thumb|<center>''Figure 6: Installing a package of templates''</center>]]</center>
+
 
+
# A file browser window opens. Find and select the package of templates you want to install and click '''Open'''.
+
# On the Extension Manager dialog (Figure 7), select the package you just added and click '''Enable'''.
+
 
+
<center>[[Image:|thumb|<center>''Figure 7: Enabling a newly-added package of templates''</center>]]</center>
+
 
+
= Setting a default template =
+
If you create a document by choosing '''File > New > Text Document '''from the main menu, Writer creates the document from the Default template. You can, however, set a custom template to be the default. You can reset the default later if you choose.
+
 
+
== Setting a custom template as the default ==
+
You can set any template to be the default, as long as it is in one of the folders displayed in the Template Management window.
+
 
+
To save a template in one of these folders, do one of the following:
+
 
+
* Create and save the template as described in “[[#Creating a template|Creating a template]]” on page [[#Creating a template|2]].
+
* Import the template into the desired folder as described in “[[#Importing a template|Importing a template]]” on page [[#Importing a template|9]].
+
 
+
To set a custom template as the default:
+
 
+
# From the main menu, choose '''File > Templates > Organize. '''The Template Management window (Figure 4) opens.
+
# In the box on the left, double-click the''' '''folder that contains the template that you want to set as the default.
+
# Click the template that you want to set as the default.
+
# Click the '''Commands '''button.
+
# From the drop-down menu, choose''' Set as Default Template. '''The next time that you create a document by choosing '''File > New > Text Document,''' the document will be created from this template.
+
 
+
== Resetting Writer’s Default template as the default ==
+
To reset Writer’s Default template as the default:
+
 
+
# From the main menu, choose '''File > Templates > Organize. '''The Template Management window (Figure 4) opens.
+
# In the box on the left, click any folder.
+
# Click the '''Commands '''button.
+
# From the drop-down menu, choose''' Reset Default Template > Text Document. '''The next time that you create a document by choosing '''File > New > Text Document,''' the document will be created from Writer’s Default template.
+
 
+
= Organizing templates =
+
Writer can only use templates that are in OOo template folders. You can, however, create new OOo template folders and use them to organize your templates. For example, you might have one template folder for report templates and another for letter templates. You can also import and export templates.
+
 
+
To begin, choose '''File > Templates > Organize''' from the main menu. The Template Management window (Figure 4) opens.
+
 
+
== Creating a template folder ==
+
To create a template folder:
+
 
+
# In the Template Management window, click any folder.
+
# Click the '''Commands '''button.
+
# From the drop-down menu, choose''' New. '''A new folder called Untitled appears.
+
# Type a name for the new folder, and then press ''Enter''. Writer saves the folder with the name that you entered.
+
# To close the Template Management window, click '''Close.'''
+
 
+
== Deleting a template folder ==
+
To delete a template folder:
+
 
+
# In the Template Management window, click the folder that you want to delete.
+
# Click the '''Commands '''button.
+
# From the drop-down menu, choose''' Delete. '''A dialog box appears and asks you to confirm the delete.
+
# Click '''Yes. '''The dialog box closes and the selected folder is deleted.
+
 
+
== Moving a template ==
+
To move a template from one template folder to another template folder:
+
 
+
# In the Template Management window, double-click the folder that contains the template that you want to move. A list of all the templates contained in that folder appears underneath the folder name.
+
# Click the template that you want to move and drag it to the desired folder.
+
 
+
== Deleting a template ==
+
To delete a template:
+
 
+
# In the Template Management window, double-click the folder that contains the template that you want to delete. A list of all the templates contained in that folder appears underneath the folder name.
+
# Click the template that you want to delete.
+
# Click the '''Commands '''button.
+
# From the drop-down menu, choose '''Delete. '''A dialog box appears and asks you to confirm the delete.
+
# Click '''Yes. '''The dialog box closes and the selected template is deleted.
+
 
+
== Importing a template ==
+
If the template that you want to use is in a different location, you must import it into an OOo template folder.
+
 
+
 
+
{| class="prettytable"
+
| <center>'''TIP'''</center>
+
| When you download a template from a website or CD, you can save it anywhere on your computer and then import it into OOo as described here.
+
 
+
|}
+
To import a template into a template folder:
+
 
+
# In the Template Management window, double-click the folder into which you want to import the template.
+
# Click the '''Commands '''button.
+
# From the drop-down menu, choose '''Import Template'''.''' '''The Open dialog box opens.
+
# Find the template that you want to import and click '''Open. '''The Open dialog box closes and the template appears in the selected folder.
+
# If you want, type a new name for the template, and then press ''Enter''.
+
 
+
== Exporting a template ==
+
To export a template from a template folder to another location:
+
 
+
# In the Template Management window, double-click the folder that contains the template that you want to export. A list of all the templates contained in that folder appears underneath the folder name.
+
# Click the template that you want to export.
+
# Click the '''Commands '''button.
+
# From the drop-down menu, choose '''Export Template'''.''' '''The Save dialog box opens.
+
# Find the folder into which you want to export the template and click '''Save. '''Writer exports the template to the selected folder, and the Save dialog box closes.
+
 
+
 
+
{| class="prettytable"
+
| '''Note'''
+
| All the actions made by the '''Commands''' button in the Template Management window can be made as well by simply right-clicking on the templates or the folders.
+
 
+
|}
+
  
  
 
{{CCBY}}
 
{{CCBY}}
[[Category: Documentation]]
+
[[Category: Writer Guide (Documentation)]]

Latest revision as of 19:27, 25 September 2009



This is Chapter 10 of the OpenOffice.org 2.x Writer Guide (Third edition), produced by the OOoAuthors group. A PDF of this chapter is available from the OOoAuthors Guides page at OpenOffice.org.

Introduction

A template is a model that you use to create other documents. For example, you can create a template for business reports that has your company's logo on the first page. New documents created from this template will all have your company's logo on the first page.

Templates can contain anything that regular documents can contain, such as text, graphics, a set of styles, and user-specific setup information such as measurement units, language, the default printer, and toolbar and menu customization.

All documents in Apache OpenOffice (AOO) are based on templates. You can create a specific template for any document type (text, spreadsheet, drawing, presentation). If you do not specify a template when you start a new document, then the document is based on the default template for that type of document. If you have not specified a default template, AOO uses the blank template for that type of document that is installed with AOO. See Setting a default template for more information.

This chapter shows you how to:


Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).
Personal tools
In other languages