📄 paragraphs.html
字号:
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../application/workbooks/workbook/documents/document/Paragraphs.html#setParagraphAttribute(application.workbooks.workbook.style.paragraph.ParagraphAttribute, boolean)">setParagraphAttribute</A></B>(<A HREF="../../../../../application/workbooks/workbook/style/paragraph/ParagraphAttribute.html" title="application.workbooks.workbook.style.paragraph 中的类">ParagraphAttribute</A> paragraphAttribute,
boolean replace)</CODE>
<BR>
对指定段落索引所在段落的字符串进行段落格式化。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../application/workbooks/workbook/documents/document/Paragraphs.html#setShadingAttribute(int, int, application.workbooks.workbook.style.border.ShadingAttribute)">setShadingAttribute</A></B>(int paragraphStartIndex,
int paragraphEndIndex,
<A HREF="../../../../../application/workbooks/workbook/style/border/ShadingAttribute.html" title="application.workbooks.workbook.style.border 中的类">ShadingAttribute</A> shadingAttribute)</CODE>
<BR>
对段落起始索引号和结束索引号之间的段落设置段落底纹。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../application/workbooks/workbook/documents/document/Paragraphs.html#setShadingAttribute(application.workbooks.workbook.style.border.ShadingAttribute)">setShadingAttribute</A></B>(<A HREF="../../../../../application/workbooks/workbook/style/border/ShadingAttribute.html" title="application.workbooks.workbook.style.border 中的类">ShadingAttribute</A> shadingAttribute)</CODE>
<BR>
对段落起始索引号和结束索引号之间的段落设置段落底纹。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../application/workbooks/workbook/documents/document/Paragraphs.html#tcscConverter(boolean)">tcscConverter</A></B>(boolean sctc)</CODE>
<BR>
对指定起始段落索引号和结束段落索引号之间的段落进行简繁体转换。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../application/workbooks/workbook/documents/document/Paragraphs.html#tcscConverter(int, int, boolean)">tcscConverter</A></B>(int paragraphStartIndex,
int paragraphEndIndex,
boolean sctc)</CODE>
<BR>
对指定起始段落索引号和结束段落索引号之间的段落进行简繁体转换。</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>从类 java.lang.Object 继承的方法</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>方法详细信息</B></FONT></TH>
</TR>
</TABLE>
<A NAME="addParagraph(java.lang.String)"><!-- --></A><H3>
addParagraph</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/documents/document/paragraphs/Paragraph.html" title="application.workbooks.workbook.documents.document.paragraphs 中的类">Paragraph</A> <B>addParagraph</B>(java.lang.String text)</PRE>
<DL>
<DD>在最后一段后添加一个新段落。说明:如果这个段落集合是从章节的某个区域获得的,则新段落添加在章节的末尾。 如果段落集合是从某个选取区域获得的,则新段落添加在选取区域的末尾。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>text</CODE> - 新段落的内容。
<DT><B>返回:</B><DD>添加的新段落。 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); Paragraphs paragraphs = baseText.getParagraphs(); Paragraph paragraph = paragraphs.addParagraph("增加一个新段落"); System.out.println("新增段落的内容是:"+paragraph.getRange().getText()); System.out.println("新增段落的索引是:"+paragraph.getIndex()); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定区域中存在保护区域</DL>
</DD>
</DL>
<HR>
<A NAME="autoFormat()"><!-- --></A><H3>
autoFormat</H3>
<PRE>
public void <B>autoFormat</B>()</PRE>
<DL>
<DD>对段落起始索引号和结束索引号之间的段落执行自动格式化(脚注尾注没有此功能)。 说明:如果这个段落集合是从章节的某个区域获得的,则对当前章节所有段落进行自动格式化操作。 如果段落集合是从某个选取区域获得的,则只对选取区域所包含的段落进行自动格式化操作。 <p> 使用前可以先调用 application.workbooks.workbook.autotext.AutoFormat中的静态方法进行设置Flag <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"replace fraction test 1/2 \n1/2 \ntest end"); TextRange range = baseText.getRange(10,15); Paragraphs paragraphs = range.getParagraphs(); AutoFormat.setReplaceFractionFlag(true); paragraphs.autoFormat(); </pre>
<P>
<DD><DL>
<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/autotext/AutoFormat.html" title="application.workbooks.workbook.autotext 中的类"><CODE>AutoFormat</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="autoFormat(int, int)"><!-- --></A><H3>
autoFormat</H3>
<PRE>
public void <B>autoFormat</B>(int paragraphStartIndex,
int paragraphEndIndex)</PRE>
<DL>
<DD>对段落起始索引号和结束索引号之间的段落执行自动格式化(脚注尾注没有此功能)。 说明:如果这个段落集合是从章节的某个区域获得的,则指定的段落索引从当前章节起始位置开始计算。 如果段落集合是从某个选取区域获得的,则指定的段落索引从选取区域起始位置开始计算。 <p> 使用前可以先调用 application.workbooks.workbook.autotext.AutoFormat中的静态方法进行设置Flag
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>paragraphStartIndex</CODE> - 要进行自动格式化的段落起始索引号<DD><CODE>paragraphEndIndex</CODE> - 要进行自动格式化的段落结束索引号 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"replace fraction test 1/2 \n1/2 \ntest end"); Paragraphs paragraphs = baseText.getParagraphs(); AutoFormat.setReplaceFractionFlag(true); paragraphs.autoFormat(0,1); //执行完宏后光标定位在“1/2”后按空格即可看到效果 </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当起始段落小于0或结束段落大于文本的最大段落
<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> - 当指定区域中存在保护区域<DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/autotext/AutoFormat.html" title="application.workbooks.workbook.autotext 中的类"><CODE>AutoFormat</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="changeCase(int)"><!-- --></A><H3>
changeCase</H3>
<PRE>
public void <B>changeCase</B>(int type)</PRE>
<DL>
<DD>对指定起始段落索引和结束段落索引之间段落的字符串更改大小写。 说明:如果这个段落集合是从章节的某个区域获得的,则对当前章节所有段落进行大小写转换。 如果段落集合是从某个选取区域获得的,则只对选取区域所包含的段落进行大小写转换。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>type</CODE> - 更改大小写的类型。只能取以下值之一: <pre> ChangeCaseConstants.SENTENCECASE 表示句首字母大写 ChangeCaseConstants.LOWERCASE 表示小写 ChangeCaseConstants.UPPERCASE 表示大写 ChangeCaseConstants.TITLECASE 表示词首字母大写 ChangeCaseConstants.TOGGLECASE 进行大小写转换,即大写字母转换为小写,小写字母转换为大写 </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 test1!\nthis is a test2!\nthis is a test3!\n"); TextRange range = baseText.getRange(10,15); Paragraphs paragraphs = range.getParagraphs(); paragraphs.changeCase(ChangeCaseConstants.UPPERCASE); </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> - 更改大小写的类型的常量不存在<DT><B>另请参见:</B><DD><A HREF="../../../../../application/constants/ChangeCaseConstants.html" title="application.constants 中的接口"><CODE>ChangeCaseConstants</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="changeCase(int, int, int)"><!-- --></A><H3>
changeCase</H3>
<PRE>
public void <B>changeCase</B>(int paragraphStartIndex,
int paragraphEndIndex,
int type)</PRE>
<DL>
<DD>对指定起始段落索引和结束段落索引之间段落的字符串更改大小写。 说明:如果这个段落集合是从章节的某个区域获得的,则指定的段落索引从当前章节起始位置开始计算。 如果段落集合是从某个选取区域获得的,则指定的段落索引从选取区域起始位置开始计算。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>paragraphStartIndex</CODE> - 更改文档大小写的起始段落<DD><CODE>paragraphEndIndex</CODE> - 更改文档大小写的结束段落<DD><CODE>type</CODE> - 更改大小写的类型。只能取以下值之一: <pre> ChangeCaseConstants.SENTENCECASE 表示句首字母大写 ChangeCaseConstants.LOWERCASE 表示小写 ChangeCaseConstants.UPPERCASE 表示大写 ChangeCaseConstants.TITLECASE 表示词首字母大写 ChangeCaseConstants.TOGGLECASE 进行大小写转换,即大写字母转换为小写,小写字母转换为大写 </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 test1!\nthis is a test2!\nthis is a test3!\n"); Paragraphs paragraphs = baseText.getParagraphs(); paragraphs.changeCase(0,1,ChangeCaseConstants.UPPERCASE); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当起始段落小于0或结束段落大于文本的最大段落
<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> - 更改大小写的类型的常量不存在<DT><B>另请参见:</B><DD><A HREF="../../../../../application/constants/ChangeCaseConstants.html" title="application.constants 中的接口"><CODE>ChangeCaseConstants</CODE></A></DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -