⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 styles.html

📁 永中OFFICE二次开发帮助文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
 <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style","标题 1",0,true,true); Style style = styles.getStyle("new style"); System.out.println(style.getName()); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 样式名称已经存在
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 指定的基准样式名字为空或不存在时
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 样式的类型不存在</DL>
</DD>
</DL>
<HR>

<A NAME="getAllStyles()"><!-- --></A><H3>
getAllStyles</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/documents/document/styles/Style.html" title="application.workbooks.workbook.documents.document.styles 中的类">Style</A>[] <B>getAllStyles</B>()</PRE>
<DL>
<DD>返回所有的样式。
<P>
<DD><DL>

<DT><B>返回:</B><DD>所有的样式 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); Style[] allStyles = styles.getAllStyles();  for (int i = 0 ; i < allStyles.length; i++) {      System.out.println(allStyles[i].getName()); } </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getCharacterStyles()"><!-- --></A><H3>
getCharacterStyles</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/documents/document/styles/Style.html" title="application.workbooks.workbook.documents.document.styles 中的类">Style</A>[] <B>getCharacterStyles</B>()</PRE>
<DL>
<DD>返回属于字符的样式。
<P>
<DD><DL>

<DT><B>返回:</B><DD>字符的样式 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); Style[] characterStyles = styles.getCharacterStyles();  for (int i = 0 ; i < characterStyles.length; i++) {      System.out.println(characterStyles[i].getName()); } </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getCustomStyles()"><!-- --></A><H3>
getCustomStyles</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/documents/document/styles/Style.html" title="application.workbooks.workbook.documents.document.styles 中的类">Style</A>[] <B>getCustomStyles</B>()</PRE>
<DL>
<DD>返回所有的用户自定义样式。
<P>
<DD><DL>

<DT><B>返回:</B><DD>用户自定义样式 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); Style[] customStyles = styles.getCustomStyles();  for (int i = 0 ; i < customStyles.length; i++) {      System.out.println(customStyles[i].getName()); } </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getParagraphStyles()"><!-- --></A><H3>
getParagraphStyles</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/documents/document/styles/Style.html" title="application.workbooks.workbook.documents.document.styles 中的类">Style</A>[] <B>getParagraphStyles</B>()</PRE>
<DL>
<DD>返回属于段落的样式。
<P>
<DD><DL>

<DT><B>返回:</B><DD>段落的样式 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); Style[] paragraphStyles = styles.getParagraphStyles();  for (int i = 0 ; i < paragraphStyles.length; i++) {      System.out.println(paragraphStyles[i].getName()); } </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getStyle(java.lang.String)"><!-- --></A><H3>
getStyle</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/documents/document/styles/Style.html" title="application.workbooks.workbook.documents.document.styles 中的类">Style</A> <B>getStyle</B>(java.lang.String&nbsp;styleName)</PRE>
<DL>
<DD>获得指定名字的样式。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>styleName</CODE> - 样式名字
<DT><B>返回:</B><DD>Style类,即样式对象 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style","标题 1",0,true,true); Style style = styles.getStyle("new style"); System.out.println(style.getName()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/documents/document/styles/Style.html" title="application.workbooks.workbook.documents.document.styles 中的类"><CODE>Style</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getUsingStyles()"><!-- --></A><H3>
getUsingStyles</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/documents/document/styles/Style.html" title="application.workbooks.workbook.documents.document.styles 中的类">Style</A>[] <B>getUsingStyles</B>()</PRE>
<DL>
<DD>返回正在使用的样式。
<P>
<DD><DL>

<DT><B>返回:</B><DD>正在使用的样式 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); Style[] usingStyles = styles.getUsingStyles();  for (int i = 0 ; i < usingStyles.length; i++) {      System.out.println(usingStyles[i].getName()); } </pre></DL>
</DD>
</DL>
<HR>

<A NAME="removeFromTemplate(java.lang.String)"><!-- --></A><H3>
removeFromTemplate</H3>
<PRE>
public void <B>removeFromTemplate</B>(java.lang.String&nbsp;styleName)</PRE>
<DL>
<DD>删除一个样式,并将模板中的这个样式一起删除。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>styleName</CODE> - 删除样式的名字 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); style.addToTemplate(); styles.removeFromTemplate("new style"); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="removeStyle(java.lang.String)"><!-- --></A><H3>
removeStyle</H3>
<PRE>
public void <B>removeStyle</B>(java.lang.String&nbsp;styleName)</PRE>
<DL>
<DD>删除一个样式。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>styleName</CODE> - 删除样式的名字 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style","标题 1",0,true,true); System.out.println("style is "+styles.getStyle("new style")); styles.removeStyle("new style"); System.out.println("style is "+styles.getStyle("new style")); </pre></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="跳过导航链接"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>类</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../application/workbooks/workbook/documents/document/Section.html" title="application.workbooks.workbook.documents.document 中的类"><B>上一个类</B></A>&nbsp;
&nbsp;<A HREF="../../../../../application/workbooks/workbook/documents/document/TableOfContent.html" title="application.workbooks.workbook.documents.document 中的类"><B>下一个类</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?application/workbooks/workbook/documents/document/Styles.html" target="_top"><B>框架</B></A>  &nbsp;
&nbsp;<A HREF="Styles.html" target="_top"><B>无框架</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>所有类</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>所有类</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  摘要:&nbsp;嵌套&nbsp;|&nbsp;字段&nbsp;|&nbsp;构造方法&nbsp;|&nbsp;<A HREF="#method_summary">方法</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
详细信息:&nbsp;字段&nbsp;|&nbsp;构造方法&nbsp;|&nbsp;<A HREF="#method_detail">方法</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
版权所有 2001-2006 无锡永中科技有限公司
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -