pagenumbers.html

来自「永中OFFICE二次开发帮助文档」· HTML 代码 · 共 1,004 行 · 第 1/4 页

HTML
1,004
字号
<DD><DL>
<DT><B>参数:</B><DD><CODE>continueSection</CODE> - 布尔型值,页码编排是否为续前节。如果为true,页码编排选项为续前节,即页码起始位置从1开始,且setStartingNumber(int)无效;                     否则,页码编排选项为设置起始页码,即页码起始位置从起始页码设定值开始 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test! this is a test!"); PageNumbers pageNumbers = section.getPageNumbers(); pageNumbers.setContinueSection(false); pageNumbers.setStartingNumber(2); pageNumbers.addPageNumber(PageNumbersConstants.POSITION_HEADER, PageNumbersConstants.ALIGNMENT_CENTER, true); </pre><DT><B>另请参见:</B><DD><CODE>PageNumberAttribute.isContinuePreviousSection()</CODE>, 
<A HREF="../../../../../../application/workbooks/workbook/documents/document/section/PageNumbers.html#setStartingNumber(int)"><CODE>setStartingNumber(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setFirstPageNumberVisible(boolean)"><!-- --></A><H3>
setFirstPageNumberVisible</H3>
<PRE>
public void <B>setFirstPageNumberVisible</B>(boolean&nbsp;show)</PRE>
<DL>
<DD>插入页码时设置首页是否显示页号(默认显示首页页号)。 注:当首页不显示页号时,第二页的页号仍为2,即页码值仍是从首页开始计算的。
<P>
<DD><DL>
<DT><B>覆盖:</B><DD>类 <CODE>application.workbooks.workbook.documents.document.PageNumberAttribute</CODE> 中的 <CODE>setFirstPageNumberVisible</CODE></DL>
</DD>
<DD><DL>
<DT><B>参数:</B><DD><CODE>show</CODE> - 布尔型值,首页是否显示页号。如果为true,首页显示页号;否则,首页不显示页号 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); PageNumbers pageNumbers = section.getPageNumbers(); pageNumbers.setFirstPageNumberVisible(false); pageNumbers.addPageNumber(PageNumbersConstants.POSITION_HEADER, PageNumbersConstants.ALIGNMENT_CENTER); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="setHeadingLeverForCharpter(int)"><!-- --></A><H3>
setHeadingLeverForCharpter</H3>
<PRE>
public void <B>setHeadingLeverForCharpter</B>(int&nbsp;headingLevel)</PRE>
<DL>
<DD>设置包含章节号的起始样式(章节号起始样式默认为标题1)。 注:章节号的起始样式应与带有标题编号段落的样式相同才能正确显示页码章节号。
<P>
<DD><DL>
<DT><B>覆盖:</B><DD>类 <CODE>application.workbooks.workbook.documents.document.PageNumberAttribute</CODE> 中的 <CODE>setHeadingLeverForCharpter</CODE></DL>
</DD>
<DD><DL>
<DT><B>参数:</B><DD><CODE>headingLevel</CODE> - 包含章节号的起始样式,只能取0-8这9个整形值,分别表示标题1-标题9 <p> <b>例子:</b> <pre> //请在正文中输入几段文字,并对这几段文字格式化项目编号,选择多级编号中的带有标题的编号,使这些段落获得标题编号。 Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test! this is a test!"); PageNumbers pageNumbers = section.getPageNumbers(); pageNumbers.setIncludeChapterNumber(true); pageNumber.setHeadingLeverForCharpter(1); pageNumbers.addPageNumber(PageNumbersConstants.POSITION_HEADER, PageNumbersConstants.ALIGNMENT_CENTER, true); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 章节号的起始样式小于0或者大于8<DT><B>另请参见:</B><DD><CODE>#getHeadingLeverForCharpter()</CODE>, 
<A HREF="../../../../../../application/workbooks/workbook/documents/document/section/PageNumbers.html#setIncludeChapterNumber(boolean)"><CODE>setIncludeChapterNumber(boolean)</CODE></A>, 
<A HREF="../../../../../../application/workbooks/workbook/documents/document/section/PageNumbers.html#setChapterPageSeparator(int)"><CODE>setChapterPageSeparator(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setIncludeChapterNumber(boolean)"><!-- --></A><H3>
setIncludeChapterNumber</H3>
<PRE>
public void <B>setIncludeChapterNumber</B>(boolean&nbsp;includeChapter)</PRE>
<DL>
<DD>设置插入页码是否包含章节号(默认页码不包含章节号)。 注:章节号的起始样式应与带有标题编号段落的样式相同才能正确显示页码章节号。
<P>
<DD><DL>
<DT><B>覆盖:</B><DD>类 <CODE>application.workbooks.workbook.documents.document.PageNumberAttribute</CODE> 中的 <CODE>setIncludeChapterNumber</CODE></DL>
</DD>
<DD><DL>
<DT><B>参数:</B><DD><CODE>includeChapter</CODE> - 插入页码是否包含章节号 <p> <b>例子:</b> <pre> //请在正文中输入几段文字,并对这几段文字格式化项目编号,选择多级编号中的带有标题的编号,使这些段落获得标题编号。 Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test! this is a test!"); PageNumbers pageNumbers = section.getPageNumbers(); pageNumber.setIncludeChapterNumber(true); pageNumber.setHeadingLeverForCharpter(1); pageNumbers.addPageNumber(PageNumbersConstants.POSITION_HEADER, PageNumbersConstants.ALIGNMENT_CENTER, true); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../../application/workbooks/workbook/documents/document/section/PageNumbers.html#isIncludeChapterNumber()"><CODE>isIncludeChapterNumber()</CODE></A>, 
<A HREF="../../../../../../application/workbooks/workbook/documents/document/section/PageNumbers.html#setHeadingLeverForCharpter(int)"><CODE>setHeadingLeverForCharpter(int)</CODE></A>, 
<A HREF="../../../../../../application/workbooks/workbook/documents/document/section/PageNumbers.html#setFirstPageNumberVisible(boolean)"><CODE>setFirstPageNumberVisible(boolean)</CODE></A>, 
<A HREF="../../../../../../application/workbooks/workbook/documents/document/section/PageNumbers.html#setChapterPageSeparator(int)"><CODE>setChapterPageSeparator(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setPageNumberFormat(int)"><!-- --></A><H3>
setPageNumberFormat</H3>
<PRE>
public void <B>setPageNumberFormat</B>(int&nbsp;formatType)</PRE>
<DL>
<DD>设置插入页码的数字样式。
<P>
<DD><DL>
<DT><B>覆盖:</B><DD>类 <CODE>application.workbooks.workbook.documents.document.PageNumberAttribute</CODE> 中的 <CODE>setPageNumberFormat</CODE></DL>
</DD>
<DD><DL>
<DT><B>参数:</B><DD><CODE>formatType</CODE> - 插入页码的数字样式,常量值如下: <pre>                FieldConstants.Arabic       数字样式为“1,2,3,...”      FieldConstants.ALPHABETIC   数字样式为“A,B,C,...”      FieldConstants.alphabetic   数字样式为“a,b,c,...”      FieldConstants.roman        数字样式为“i,ii,iii,...”      FieldConstants.ROMAN        数字样式为“I,II,III,...”      FieldConstants.ARABIC_DASH  数字样式为“- 1 -,- 2 -,- 3 -,...”      FieldConstants.DBCHAR       数字样式为“全角”      FieldConstants.CHINESENUM2  数字样式为“壹,贰,叁,...”      FieldConstants.CHINESENUM3  数字样式为“一,二,三(简),...”      FieldConstants.ZODIAC1      数字样式为“甲,乙,丙,...”      FieldConstants.ZODIAC2      数字样式为“子,丑,寅,...”      FieldConstants.GB1          数字样式为“⒈,⒉,⒊,...”      FieldConstants.GB2          数字样式为“⑴,⑵,⑶,...”      FieldConstants.GB3          数字样式为“①,②,③,...”      FieldConstants.GB4          数字样式为“㈠,㈡,㈢,...”  </pre> <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test! this is a test!"); PageNumbers pageNumbers = section.getPageNumbers(); pageNumbers.setPageNumberFormat(FieldConstants.GB3); pageNumbers.addPageNumber(PageNumbersConstants.POSITION_HEADER, PageNumbersConstants.ALIGNMENT_CENTER, true); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 指定的常量不存在<DT><B>另请参见:</B><DD><A HREF="../../../../../../application/workbooks/workbook/documents/document/section/PageNumbers.html#getPageNumberFormat()"><CODE>getPageNumberFormat()</CODE></A>, 
<A HREF="../../../../../../application/constants/FieldConstants.html" title="application.constants 中的接口"><CODE>FieldConstants</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setStartingNumber(int)"><!-- --></A><H3>
setStartingNumber</H3>
<PRE>
public void <B>setStartingNumber</B>(int&nbsp;pageStartNumber)</PRE>
<DL>
<DD>设置起始页码。 注:只有当页码编排选项为设置起始页码时,此方法才有效。
<P>
<DD><DL>
<DT><B>覆盖:</B><DD>类 <CODE>application.workbooks.workbook.documents.document.PageNumberAttribute</CODE> 中的 <CODE>setStartingNumber</CODE></DL>
</DD>
<DD><DL>
<DT><B>参数:</B><DD><CODE>pageStartNumber</CODE> - 起始页码 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test! this is a test!"); PageNumbers pageNumbers = section.getPageNumbers(); pageNumbers.setContinueSection(false); pageNumbers.setStartingNumber(2); pageNumbers.addPageNumber(PageNumbersConstants.POSITION_HEADER, PageNumbersConstants.ALIGNMENT_CENTER, true); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../../application/workbooks/workbook/documents/document/section/PageNumbers.html#setContinueSection(boolean)"><CODE>setContinueSection(boolean)</CODE></A>, 
<A HREF="../../../../../../application/workbooks/workbook/documents/document/section/PageNumbers.html#getStartingNumber()"><CODE>getStartingNumber()</CODE></A></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/PageNumber.html" title="application.workbooks.workbook.documents.document.section 中的类"><B>上一个类</B></A>&nbsp;
&nbsp;下一个类</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?application/workbooks/workbook/documents/document/section/PageNumbers.html" target="_top"><B>框架</B></A>  &nbsp;
&nbsp;<A HREF="PageNumbers.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 + =
减小字号Ctrl + -
显示快捷键?