Sunteți pe pagina 1din 13

Writer Guide

Chapter 10
Working with Templates
Copyright
This document is Copyright 20052010 by its contributors as listed below. You may
distribute it and/or modify it under the terms of either the !" eneral #ublic
$icense %http&//www.gnu.org/licenses/gpl.html'( )ersion * or later( or the Creati)e
Commons +ttribution $icense %http&//creati)ecommons.org/licenses/by/*.0/'( )ersion
*.0 or later.
+ll trademar,s within this guide belong to their legitimate owners.
Contributors
+lan -adden
#aul -iller
Catherine .aterman
/ean 0ollis .eber
-ichele 1arri
#reston 2ernstein
Feedback
#lease direct any comments or suggestions about this document to&
authors3documentation.openoffice.org
Publication date and software version
#ublished 22 4ctober 2010. 2ased on 4pen4ffice.org *.*.
Note for Mac users
5ome ,eystro,es and menu items are different on a -ac from those used in .indows
and $inu6. The table below gi)es some common substitutions for the instructions in
this chapter. 7or a more detailed list( see the application 0elp.
Windows/Linux Mac equivalent Effect
Tools > Options
menu selection
OpenOffice.org >
Preferences
+ccess setup options
Right-click Control+click 4pen conte6t menu
Ctrl (Control) z (Command) "sed with other ,eys
F5 Shift+z+F5 4pen the !a)igator
F11 z8T 4pen 5tyles 9 7ormatting window
You can download
an editable er!ion of thi! document from
htt"#$$oooauthor!%org$engli!h$u!erguide&$"ubli!hed$
Contents
Copyright...........................................................................................................................2
!ote for -ac users...........................................................................................................2
:ntroduction.......................................................................................................................;
"sing a template to create a document...........................................................................;
Creating a template..........................................................................................................5
Creating a template from a document.........................................................................5
Creating a template using a wi<ard.............................................................................=
>diting a template.............................................................................................................?
"pdating a document from a changed template.........................................................@
+dding templates with >6tension -anager.....................................................................A
5etting a default template..............................................................................................10
5etting a custom template as the default..................................................................10
Besetting .riterCs Default template as the default...................................................11
+ssociating a document with a different template........................................................11
4rgani<ing templates......................................................................................................12
Creating a template folder.........................................................................................12
Deleting a template folder..........................................................................................12
-o)ing a template......................................................................................................12
Deleting a template.....................................................................................................1*
:mporting a template..................................................................................................1*
>6porting a template..................................................................................................1*
'orking with Tem"late! &
Introduction
+ template is a model that you use to create other documents. 7or e6ample( you can
create a template for business reports that has your companyCs logo on the first page.
!ew documents created from this template will all ha)e your companyCs logo on the
first page.
Templates can contain anything that regular documents can contain( such as te6t(
graphics( a set of styles( and userEspecific setup information such as measurement
units( language( the default printer( and toolbar and menu customi<ation.
+ll documents in 4pen4ffice.org %44o' are based on templates. :f you do not specify
a template when you start a new .riter document( the document is based on the
default template for te6t documents. :f you ha)e not specified a default template(
.riter uses the blan, template for te6t documents that is installed with 44o. 5ee
F5etting a default templateG on page 10 for more information.
Using a template to create a document
To use a template to create a document&
1' 7rom the main menu( choose File > New > Templates and Documents. The
Templates and Documents dialog bo6 opens. %5ee 7igure 1.'
2' :n the bo6 on the left( clic, the Templates icon if it is not already selected. +
list of template folders appears in the center bo6.
*' DoubleEclic, the folder that contains the template that you want to use. + list
of all the templates contained in that folder appears in the center bo6.
;' 5elect the template that you want to use. You can pre)iew the selected
template or )iew the templateCs properties&
H To pre)iew the template( clic, the Preview icon . + pre)iew of the
template appears in the bo6 on the right.
H To )iew the templateCs properties( clic, the Document Properties icon
. The templateCs properties appear in the bo6 on the right.
5' Clic, Open. The Templates and Documents dialog bo6 closes and a new
document based on the selected template opens in .riter. You can then edit
and sa)e the new document Iust as you would any other document.
( 'orking with Tem"late!
Figure 1% Tem"late! and )ocument! dialog bo*
Creating a template
You can create your own templates in two ways& from a document( and using a
wi<ard.
Creating a template from a document
To create a template from a document&
1' 4pen a new or e6isting document you want to ma,e into a template.
2' +dd the content and styles that you want.
*' 7rom the main menu( choose File > Templates > Save. The Templates dialog
bo6 opens %see 7igure 2'.
;' :n the New template field( type a name for the new template.
5' :n the Categories list( select the category to which you want to assign the
template. The category is simply the template folder in which you want to sa)e
the template. 7or e6ample( to sa)e the template in the F-y TemplatesG folder(
clic, the My Templates category.
To learn more about template folders( see F4rgani<ing templatesG on page 12.
=' Clic, O to sa)e the new template.
Creating a tem"late 5
Figure +% Saing a new tem"late
+ny settings that can be added to or modified in a document can be sa)ed in a
template. 7or e6ample( below are some of the settings %although not a full list' that
can be included in a .riter document and then sa)ed as a template for later use&
H #rinter settings& which printer( singleEsided or doubleEsided printing( paper
si<e( and so on.
H 5tyles to be used( including character( page( frame( numbering( and paragraph
styles.
H 7ormat and settings regarding inde6es( tables( bibliographies( table of
contents.
Templates can also contain predefined te6t( sa)ing you from ha)ing to type it e)ery
time you create a new document. 7or e6ample( a letter template may contain your
name( address and salutation.
You can also sa)e menu and toolbar customi<ations in templatesJ see Chapter 1;
%Customi<ing 4pen4ffice.org' for more information.
Creating a template using a wizard
You can use wi<ards to create .riter templates for letters( fa6es( and agendas.
7or e6ample( the 7a6 .i<ard steps you through the following choices&
H Type of fa6 %business or personal'
H Document elements li,e the date( subIect line %business fa6'( salutation( and
complimentary close
H 4ptions for sender and recipient information %business fa6'
H Te6t to include in the footer %business fa6'
To create a template using a wi<ard&
1' 7rom the main menu( choose File > !i"ards K Ltype of template reMuiredN.
, 'orking with Tem"late!
Figure &# Creating a tem"late u!ing a wi-ard
2' 7ollow the instructions on the pages of the wi<ard. This process is slightly
different for each type of template( but the format is similar for all of them.
*' :n the last section of the wi<ard( you can specify the name and location for
sa)ing the template. The default location is your user templates directory( but
you can choose a different location if you prefer.
;' 7inally( you ha)e the option of creating a new document from your template
immediately( or manually changing the template. 7or future documents( you
can reEuse the template created by the wi<ard( Iust as you would use any other
template.
diting a template
You can edit a templateCs styles and content( and then( if you wish( you can reapply
the templateCs styles to documents that were created from that template. %!ote that
you can only reapply styles. You cannot reapply content( e6cept for content in
headers and footers.'
To edit a template&
1' 7rom the main menu( choose File > Templates > Organi"e. The Template
-anagement dialog bo6 opens %see 7igure ;'.
2' :n the bo6 on the left( doubleEclic, the folder containing the template that you
want to edit. + list of all the templates contained in that folder appears
underneath the folder name.
*' 5elect the template that you want to edit.
;' Clic, the Commands button and choose #dit from the dropEdown menu.
5' >dit the template Iust as you would any other document. To sa)e your changes(
choose File > Save from the main menu.
.diting a tem"late /
Figure (% Tem"late management dialog bo*
Updating a document from a changed template
The ne6t time that you open a document that was created from the changed template(
the following message appears.
Figure 5% 0"date !t1le! me!!age
Clic, $pdate Styles to apply the templateCs changed styles to the document. Clic,
eep Old Styles if you do not want to apply the templateCs changed styles to the
document %but see Caution notice below'.
Caution
:f you choose eep Old Styles in the message bo6 shown in 7igure 5(
that message will not appear again the ne6t time you open the document
after changing the template it is based on. You will not get another
chance to update the styles from the template( although you can use the
macro gi)en in the !ote below to reEenable this feature.
You can also use the Template Changer e6tension %see page 11' to
reacti)ate the template.
2 'orking with Tem"late!
Note
To reEenable updating from a template&
1' "se Tools > Macros > Organi"e Macros > OpenOffice.org
%asic. 5elect the document from the list( clic, the e6pansion symbol
%8 or triangle'( and select 5tandard. :f 5tandard has an e6pansion
symbol beside it( clic, that and select a module.
2' :f the #dit button is acti)e( clic, it. :f the >dit button is not acti)e(
clic, New.
*' :n the 2asic window( enter the following&
Sub FixDocV3
' set UpdateFromTemplate
oDocSettings = ThisComponent.createInstance !
"com.sun.star.document.Settings" #
oDocSettings.UpdateFromTemplate = True
$nd Sub 'FixDocV3
;' Clic, the &un %'S(C icon( then close the 2asic window.
5' 5a)e the document.
!e6t time when you open this document you will ha)e the update from
template feature bac,.
!dding templates with "tension Manager
The >6tension -anager pro)ides an easy way to install collections of templates(
graphics( macros( or other addEins that ha)e been Fpac,agedG into files with a .4OT
e6tension. 5ee Chapter 1= %Customi<ing .riter' for more about the >6tension
-anager.
This .eb page lists many of the a)ailable e6tensions&
http&//e6tensions.ser)ices.openoffice.org/.
To install an e6tension( follow these steps&
1' Download the e6tension pac,age and sa)e it anywhere on your computer.
2' :n .riter( select Tools > #)tension Manager from the menu bar. :n the
>6tension -anager dialog bo6( clic, 'dd.
*' + file browser window opens. 7ind and select the pac,age of templates you
want to install and clic, Open. The pac,age begins installing. You may be
as,ed to accept a license agreement.
;' .hen the pac,age installation is complete( the templates are a)ailable for use
through File > New > Templates and Documents and the e6tension is listed
in the >6tension -anager.
3dding tem"late! with .*ten!ion 4anager 5
Figure ,# 6ewl1-added "ackage of tem"late!
#etting a default template
:f you create a document by choosing File > New > Te)t Document from the main
menu( .riter creates the document from the Default template for te6t documents.
You can( howe)er( set a custom template to be the default. You can reset the default
later if you choose.
#etting 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 -anagement window. :f necessary( you can add the
template to a folder as described in F:mporting a templateG on page 1*.
To set a custom template as the default&
1' 7rom the main menu( choose File > Templates > Organi"e. The Template
-anagement dialog bo6 %7igure ;' opens.
2' :n the bo6 on the left( select the folder that contains the template that you
want to set as the default( then select the template.
*' Clic, the Commands button and choose Set as Default Template from the
dropEdown menu.
The ne6t time that you create a document by choosing File > New > Te)t
Document* the document will be created from this template.
+lthough many important settings can be changed in the 4ptions dialog %see Chapter
2'( for e6ample default fonts and page si<e( more ad)anced settings %such as page
margins' can only be changed by replacing the default template with a new one.
17 'orking with Tem"late!
$esetting %riter&s 'efault template as the default
To reEenable .riterCs Default template as the default&
1' :n the Template -anagement dialog bo6 %7igure ;'( select any folder in the
bo6 on the left.
2' Clic, the Commands button and choose &eset Default Template > Te)t
Document from the dropEdown menu.
The ne6t time that you create a document by choosing File > New > Te)t
Document* the document will be created from .riterCs Default template.
!ssociating a document with a different template
+t times you might want to associate a document with a different template( or
perhaps youCre wor,ing with a document that did not start from a template.
4ne of the maIor ad)antages of using templates is the ease of updating styles in more
than one document( as described in Chapter ? %.or,ing with 5tyles'. :f you update
styles by loading a new set of styles from a different template %as described in
Chapter ?'( the document has no association with the template from which the styles
were loadedPso you cannot use this method. .hat you need to do is associate the
document with the different template.
You can do this in two ways. :n both cases( for best results the names of styles should
be the same in the e6isting document and the new template. :f they are not( you will
need to use 5earch and Beplace to replace old styles with new ones. 5ee Chapter *
%.or,ing with Te6t' for more about replacing styles using 5earch and Beplace.
Method (
This method includes any graphics and wording %such as legal notices' that e6ists in
the new template( as well as including styles. :f you donCt want this material( you
need to delete it.
1' "se File > New > Templates and Documents. Choose the template you
want. + new file is created from the template. :f the template has unwanted
te6t or graphics in it( delete them from this new file.
2' 4pen the document you want to change. %:t opens in a new window.' #ress
Control+3 to select e)erything in the document. #aste into the blan,
document created in step 1.
*' "pdate the table of contents( if there is one. 5a)e the file.
Method )
This method does not include any graphics or te6t from the new template( e6cept
material in headers and footersJ it simply includes styles from the new template and
establishes an association between the template and the document.
1' Download the Template Changer e6tension from
http&//e6tensions.ser)ices.openoffice.org/ and install it as described on page A.
2' Close and reopen 4pen4ffice.org. !ow the File > Templates menu has two
new choices& 3!!ign Tem"late (current document) and 3!!ign Tem"late
(folder).
*' 4pen the document whose template you want to change. Choose File >
Templates > 'ssign Template +current document,.
;' :n the 5elect Template window( find and select the reMuired template and clic,
Open.
3!!ociating a document with a different tem"late 11
5' 5a)e the document. :f you now loo, in File > Properties( you will see the new
template listed at the bottom of the eneral page.
*rganizing templates
.riter can only use templates that are in 44o template folders. You can( howe)er(
create new 44o template folders and use them to organi<e your templates. 7or
e6ample( you might ha)e one template folder for report templates and another for
letter templates. You can also import and e6port templates.
To begin( choose File > Templates > Organi"e from the main menu. The Template
-anagement dialog bo6 %7igure ;' opens.
Note
+ll the actions made by the Commands button in the Template
-anagement dialog bo6 can be made as well by simply rightEclic,ing on
the templates or the folders.
Creating a template folder
To create a template folder&
1' :n the Template -anagement dialog bo6( select any folder.
2' Clic, the Commands button and choose New from the dropEdown menu. +
new folder called 0ntitled appears.
*' Type a name for the new folder( and then press .nter. .riter sa)es the folder
with the name that you entered.
'eleting a template folder
You cannot delete template folders supplied with 44o or installed using the
>6tension -anagerJ you can only delete template folders that you ha)e created. %:f
you ha)e administrator pri)ileges( you can delete any folder.'
To delete a template folder&
1' :n the Template -anagement dialog bo6( select the folder that you want to
delete.
2' Clic, the Commands button and choose Delete from the dropEdown menu. +
message bo6 appears and as,s you to confirm the deletion. Clic, -es.
Moving a template
To mo)e a template from one template folder to another template folder&
1' :n the Template -anagement dialog bo6( doubleEclic, the folder that contains
the template that you want to mo)e. + list of all the templates contained in that
folder appears underneath the folder name.
2' Clic, the template that you want to mo)e and drag it to the desired folder. :f
you do not ha)e the authority to delete templates from the source folder( this
action co"ie! the template instead of mo)ing it.
1+ 'orking with Tem"late!
'eleting a template
You cannot delete templates supplied with 44o or installed using the >6tension
-anagerJ you can only delete templates that you ha)e created. %:f you ha)e
administrator pri)ileges( you can delete any template.'
To delete a template&
1' :n the Template -anagement dialog bo6( doubleEclic, the folder that contains
the template that you want to delete. + list of all the templates contained in
that folder appears underneath the folder name.
2' Clic, the template that you want to delete.
*' Clic, the Commands button and choose Delete from the dropEdown menu. +
message bo6 appears and as,s you to confirm the deletion. Clic, -es.
Importing a template
:f the template that you want to use is in a different location( you must import it into
an 44o template folder.
To import a template into a template folder&
1' :n the Template -anagement dialog bo6( select the folder into which you want
to import the template.
2' Clic, the Commands button and choose (mport Template from the dropE
down menu. + standard file browser window opens.
*' 7ind and select the template that you want to import( and then clic, Open.
The file browser window closes and the template appears in the selected
folder.
;' :f you want( type a new name for the template( and then press .nter.
"porting a template
To e6port a template from a template folder to another location&
1' :n the Template -anagement dialog bo6( doubleEclic, the folder that contains
the template that you want to e6port. + list of all the templates contained in
that folder appears underneath the folder name.
2' 5elect the template that you want to e6port.
*' Clic, the Commands button and choose #)port Template from the dropE
down menu. The 5a)e +s window opens.
;' 7ind the folder into which you want to e6port the template and clic, Save.
8rgani-ing tem"late! 1&

S-ar putea să vă placă și