<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Ftemplates</id>
	<title>EN/documentation/basic guide/templates - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Ftemplates"/>
	<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/templates&amp;action=history"/>
	<updated>2026-11-11T13:59:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/templates&amp;diff=15923&amp;oldid=prev</id>
		<title>Sancho: Основной текст</title>
		<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/templates&amp;diff=15923&amp;oldid=prev"/>
		<updated>2011-09-02T16:14:06Z</updated>

		<summary type="html">&lt;p&gt;Основной текст&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;section begin=title /&amp;gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:&amp;lt;/noinclude&amp;gt;Styles and Templates&amp;lt;noinclude&amp;gt;}}&amp;lt;/noinclude&amp;gt;&amp;lt;section end=title /&amp;gt;{{BreadCrumbL10n}}&lt;br /&gt;
&lt;br /&gt;
{{Documentation/BASICGuideTOC&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|ShowPrevPage=block&lt;br /&gt;
|PrevPage=EN/documentation/basic_guide/stardesktop&lt;br /&gt;
|NextPage=EN/documentation/basic_guide/text_documents&lt;br /&gt;
|docs=block&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
==Styles==&lt;br /&gt;
&lt;br /&gt;
Styles are named lists containing formatting attributes. They work in all applications of {{OOo}} and help to significantly simplify formatting. If the user changes one of the attributes of a style, then {{OOo}} automatically adjusts all document sections depending on the attribute. The user can therefore, for example, change the font type of all level one headers by means of a central modification in the document. &lt;br /&gt;
&lt;br /&gt;
=== Style Types ===&lt;br /&gt;
&lt;br /&gt;
Depending on the relevant document types, {{OOo}} recognizes a whole range of different types of styles. &lt;br /&gt;
&lt;br /&gt;
{{OOo}} Writer supports the following types of styles:&lt;br /&gt;
&lt;br /&gt;
* Character styles&lt;br /&gt;
* Paragraph styles&lt;br /&gt;
* Frame styles&lt;br /&gt;
* Page styles&lt;br /&gt;
* Numbering styles&lt;br /&gt;
&lt;br /&gt;
{{OOo}} Calc supports the following types of styles:&lt;br /&gt;
&lt;br /&gt;
* Cell styles&lt;br /&gt;
* Page styles&lt;br /&gt;
&lt;br /&gt;
{{OOo}} Impress supports the following types of styles:&lt;br /&gt;
&lt;br /&gt;
* Character element styles&lt;br /&gt;
* Presentation styles&lt;br /&gt;
&lt;br /&gt;
In {{OOo}} terminology, the different types of styles are called &amp;lt;tt&amp;gt;StyleFamilies&amp;lt;/tt&amp;gt; in accordance with the &amp;lt;idl&amp;gt;com.sun.star.style.StyleFamily&amp;lt;/idl&amp;gt; service on which they are based. The &amp;lt;tt&amp;gt;StyleFamilies&amp;lt;/tt&amp;gt; are accessed by means of the document object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Doc As Object&lt;br /&gt;
Dim Sheet As Object &lt;br /&gt;
Dim StyleFamilies As Object &lt;br /&gt;
Dim CellStyles As Object&lt;br /&gt;
&lt;br /&gt;
Doc = ThisComponent&lt;br /&gt;
StyleFamilies = Doc.StyleFamilies&lt;br /&gt;
CellStyles = StyleFamilies.getByName(&amp;quot;CellStyles&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example uses the &amp;lt;tt&amp;gt;StyleFamilies&amp;lt;/tt&amp;gt; property of a spreadsheet document to establish a list containing all available cell styles. &lt;br /&gt;
&lt;br /&gt;
The individual styles can be accessed directly by means of an index: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Doc As Object&lt;br /&gt;
Dim Sheet As Object&lt;br /&gt;
Dim StyleFamilies As Object &lt;br /&gt;
Dim CellStyles As Object&lt;br /&gt;
Dim CellStyle As Object&lt;br /&gt;
Dim I As Integer&lt;br /&gt;
&lt;br /&gt;
Doc = ThisComponent&lt;br /&gt;
StyleFamilies = Doc.StyleFamilies&lt;br /&gt;
CellStyles = StyleFamilies.getByName(&amp;quot;CellStyles&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
For I = 0 To CellStyles.Count - 1&lt;br /&gt;
  CellStyle = CellStyles(I)&lt;br /&gt;
  MsgBox CellStyle.Name&lt;br /&gt;
Next I&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The loop added since the previous example displays the names of all cell styles one after another in a message box.&lt;br /&gt;
{{Note|The reference &amp;lt;tt&amp;gt;CellStyles(I)&amp;lt;/tt&amp;gt; corresponds to the method &amp;lt;tt&amp;gt;getByIndex()&amp;lt;/tt&amp;gt;, which is optional for these style container objects. It may not be available in all types of documents.&lt;br /&gt;
The method &amp;lt;tt&amp;gt;getByName()&amp;lt;/tt&amp;gt; is mandatory, and should always be available.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Details about various formatting options ===&lt;br /&gt;
&lt;br /&gt;
Each type of style provides a whole range of individual formatting properties. Here is an overview of the most important formatting properties and the points at which they are explained:&lt;br /&gt;
&lt;br /&gt;
* [[EN/documentation/basic_guide/structure_of_text_documents#Character Properties|Character properties]], &amp;lt;idl&amp;gt;com.sun.star.style.CharacterProperties&amp;lt;/idl&amp;gt; service&lt;br /&gt;
* [[EN/documentation/basic_guide/structure_of_text_documents#Paragraph Properties|Paragraph properties]], &amp;lt;idl&amp;gt;com.sun.star.text.Paragraph&amp;lt;/idl&amp;gt; service&lt;br /&gt;
* [[EN/documentation/basic_guide/formatting_spreadsheet_documents#Cell Properties|Cell properties]], &amp;lt;idl&amp;gt;com.sun.star.table.CellProperties&amp;lt;/idl&amp;gt; service&lt;br /&gt;
* [[EN/documentation/basic_guide/formatting_spreadsheet_documents#Page Properties|Page properties]], &amp;lt;idl&amp;gt;com.sun.star.style.PageProperties&amp;lt;/idl&amp;gt; service&lt;br /&gt;
* [[EN/documentation/basic_guide/formatting_spreadsheet_documents|Character element properties]], Various services&lt;br /&gt;
&lt;br /&gt;
The format properties are by no means restricted to the applications in which these are explained, but instead can be used universally. For example, most of the page properties described in [[EN/documentation/basic_guide/spreadsheets|Spreadsheets]] can therefore be used not only in {{OOo}} Calc, but also in {{OOo}} Writer.&lt;br /&gt;
&lt;br /&gt;
More information about working with styles can be found in the [[EN/documentation/basic_guide/structure_of_text_documents#Default values for character and paragraph properties|'''Default values for character and paragraph properties''']] section in [[EN/documentation/basic_guide/text_documents|Text Documents]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Templates==&lt;br /&gt;
&lt;br /&gt;
Templates are auxiliary documents. They provide a very convenient way to store, maintain, and distribute styles, macros, boiler-plate text, and other useful things.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Document and Template Types===&lt;br /&gt;
&lt;br /&gt;
Each major type of {{OOo}} document has its own associated template type. In general, and for styles in particular, you can access information within a template in the same way you would access the same information in the associated document type. In other words, code (like the above examples) that works in a particular document type should also work for the associated template type.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Automatic Update===&lt;br /&gt;
&lt;br /&gt;
Most template types – Draw templates are the exception – have an automatic-update feature. If a style in the template has been changed, and you open a document created with that template, you will see a message asking whether to update the styles in the document. If you click on '''Yes''', the new or changed styles will be copied into the document. Styles deleted from the template are not removed from documents.&lt;br /&gt;
&lt;br /&gt;
A problem may arise if you click on '''No''': the styles will not be updated, and the automatic-update feature will be turned off. As of {{OOo}} Version 3.1, this status does not show in the GUI, nor is there any GUI way to re-enable the feature. (For Writer documents only, you can use the [http://extensions.services.openoffice.org/project/templatechanger Template Changer extension] to set this feature again.)&lt;br /&gt;
&lt;br /&gt;
The following subroutine, adapted from the Template Changer extension, will re-enable the update feature for all document types.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Sub FixUpdate&lt;br /&gt;
  Dim oDocSettings as Object&lt;br /&gt;
  oDocSettings = ThisComponent.createInstance( &amp;quot;com.sun.star.document.Settings&amp;quot; )&lt;br /&gt;
  oDocSettings.UpdateFromTemplate = True&lt;br /&gt;
End Sub 'FixUpdate&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;/div&gt;</summary>
		<author><name>Sancho</name></author>
		
	</entry>
</feed>