Difference between revisions of "ZH/Documentation/BASIC Guide/Templates"

From Apache OpenOffice Wiki
Jump to: navigation, search
(New page: {{DISPLAYTITLE:模板}} {{ZH/Documentation/BASICGuideTOC/v2 |ShowPrevNext=block |ShowPrevPage=block |PrevPage=Documentation/BASIC Guide/StarDesktop |NextPage=Documentation/BASIC Guide/Text...)
 
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
|ShowPrevNext=block
 
|ShowPrevNext=block
 
|ShowPrevPage=block
 
|ShowPrevPage=block
|PrevPage=Documentation/BASIC Guide/StarDesktop
+
|PrevPage=ZH/Documentation/BASIC Guide/StarDesktop
|NextPage=Documentation/BASIC Guide/Text Documents
+
|NextPage=ZH/Documentation/BASIC Guide/Text Documents
 
|docs=block
 
|docs=block
 
}}
 
}}
Line 69: Line 69:
 
每种模板类型都提供了多种格式设置属性。此处简要说明了最重要的格式设置属性以及对其进行解释的具体位置:
 
每种模板类型都提供了多种格式设置属性。此处简要说明了最重要的格式设置属性以及对其进行解释的具体位置:
  
* [[Documentation/BASIC Guide/Structure of Text Documents#Character Properties|字符属性]],<idl>com.sun.star.style.CharacterProperties</idl> 服务
+
* [[ZH/Documentation/BASIC Guide/Structure of Text Documents#Character Properties|字符属性]],<idl>com.sun.star.style.CharacterProperties</idl> 服务
* [[Documentation/BASIC Guide/Structure of Text Documents#Paragraph Properties|段落属性]],<idl>com.sun.star.text.Paragraph</idl> 服务
+
* [[ZH/Documentation/BASIC Guide/Structure of Text Documents#Paragraph Properties|段落属性]],<idl>com.sun.star.text.Paragraph</idl> 服务
* [[Documentation/BASIC Guide/Formatting Spreadsheet Documents#Cell Properties|单元格属性]],<idl>com.sun.star.table.CellProperties</idl> 服务
+
* [[ZH/Documentation/BASIC Guide/Formatting Spreadsheet Documents#Cell Properties|单元格属性]],<idl>com.sun.star.table.CellProperties</idl> 服务
* [[Documentation/BASIC Guide/Formatting Spreadsheet Documents#Page Properties|页面属性]],<idl>com.sun.star.style.PageProperties</idl> 服务
+
* [[ZH/Documentation/BASIC Guide/Formatting Spreadsheet Documents#Page Properties|页面属性]],<idl>com.sun.star.style.PageProperties</idl> 服务
* [[Documentation/BASIC Guide/Formatting Spreadsheet Documents|字符元素属性]],各种服务
+
* [[ZH/Documentation/BASIC Guide/Formatting Spreadsheet Documents|字符元素属性]],各种服务
  
这些格式属性决不仅限于在解释它们时所提到的应用程序中使用,而是可以广泛使用。例如,[[Documentation/BASIC Guide/Spreadsheets|电子表格]]中介绍的大多数页面属性不仅可以用于 {{OOo}} Calc,而且还可以用于 {{OOo}} Writer。
+
这些格式属性决不仅限于在解释它们时所提到的应用程序中使用,而是可以广泛使用。例如,[[ZH/Documentation/BASIC Guide/Spreadsheets|电子表格]]中介绍的大多数页面属性不仅可以用于 {{OOo}} Calc,而且还可以用于 {{OOo}} Writer。
  
有关使用模板的详细信息,请参见[[Documentation/BASIC Guide/Text Documents|文本文档]]中的'''字符和段落属性的默认值'''一节。
+
有关使用模板的详细信息,请参见[[ZH/Documentation/BASIC Guide/Text Documents|文本文档]]中的'''字符和段落属性的默认值'''一节。
  
 
{{PDL1}}
 
{{PDL1}}
 +
 +
 
{{InterWiki_Languages_BasicGuide|articletitle=Documentation/BASIC Guide/Templates}}
 
{{InterWiki_Languages_BasicGuide|articletitle=Documentation/BASIC Guide/Templates}}

Latest revision as of 22:29, 16 December 2008

doc OOo
Book.png

模板是包含格式设置属性的命名列表。它们应用于所有 Apache OpenOffice 应用程序,有助于大大简化格式设置过程。如果用户更改了模板的某个属性,Apache OpenOffice 将根据此属性自动调整文档的所有部分。例如,通过对文档进行集中修改,用户可以更改所有一级标题的字体类型。根据相关的文档类型,Apache OpenOffice 可以识别各种不同的模板类型。

Apache OpenOffice Writer 支持以下模板:

  • 字符模板
  • 段落模板
  • 框架模板
  • 页面模板
  • 编号模板

Apache OpenOffice Calc 支持以下模板:

  • 单元格模板
  • 页面模板

Apache OpenOffice Impress 支持以下模板:

  • 字符元素模板
  • 演示文稿模板

在 Apache OpenOffice 术语中,各种类型的模板统称为 StyleFamilies(与这些模板所基于的 com.sun.star.style.StyleFamily 服务一致)。StyleFamilies 是通过文档对象访问的:

Dim Doc As Object
Dim Sheet As Object 
Dim StyleFamilies As Object 
Dim CellStyles As Object
 
Doc = StarDesktop.CurrentComponent
StyleFamilies = Doc.StyleFamilies
CellStyles = StyleFamilies.getByName("CellStyles")

本示例将使用电子表格文档的 StyleFamilies 属性创建一个列表,其中包含所有可用的单元格模板。

可通过索引直接访问各个模板:

Dim Doc As Object
Dim Sheet As Object
Dim StyleFamilies As Object 
Dim CellStyles As Object
Dim CellStyle As Object
Dim I As Integer
 
Doc = StarDesktop.CurrentComponent
StyleFamilies = Doc.StyleFamilies
CellStyles = StyleFamilies.getByName("CellStyles")
 
For I = 0 To CellStyles.Count - 1
  CellStyle = CellStyles(I)
  MsgBox CellStyle.Name
Next I

与上一示例相比,本示例添加了一个循环,以便在消息框内依次显示所有单元格模板的名称。

有关各种格式设置选项的详细信息

每种模板类型都提供了多种格式设置属性。此处简要说明了最重要的格式设置属性以及对其进行解释的具体位置:

这些格式属性决不仅限于在解释它们时所提到的应用程序中使用,而是可以广泛使用。例如,电子表格中介绍的大多数页面属性不仅可以用于 Apache OpenOffice Calc,而且还可以用于 Apache OpenOffice Writer。

有关使用模板的详细信息,请参见文本文档中的字符和段落属性的默认值一节。

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools