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

📄 paragraphs.html

📁 永中OFFICE二次开发帮助文档
💻 HTML
📖 第 1 页 / 共 5 页
字号:
</DD>
</DL>
<HR>

<A NAME="clearFormats()"><!-- --></A><H3>
clearFormats</H3>
<PRE>
public void <B>clearFormats</B>()</PRE>
<DL>
<DD>清除指定起始段落索引和结束段落索引之间所在段落的字符串的段落属性。 说明:如果这个段落集合是从章节的某个区域获得的,则对当前章节所有段落进行格式化操作。 如果段落集合是从某个选取区域获得的,则只对选取区域所包含的段落进行格式化操作。
<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,"this is a test1!\nthis is a test2!\nthis is a test3!\n"); TextRange range = baseText.getRange(10,15); Paragraphs paragraphs = baseText.getParagraphs(); paragraphs.clearFormats(); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定区域中存在保护区域</DL>
</DD>
</DL>
<HR>

<A NAME="clearFormats(int, int)"><!-- --></A><H3>
clearFormats</H3>
<PRE>
public void <B>clearFormats</B>(int&nbsp;paragraphStartIndex,
                         int&nbsp;paragraphEndIndex)</PRE>
<DL>
<DD>清除指定起始段落索引和结束段落索引之间所在段落的字符串的段落属性。 说明:如果这个段落集合是从章节的某个区域获得的,则指定的段落索引从当前章节起始位置开始计算。 如果段落集合是从某个选取区域获得的,则指定的段落索引从选取区域起始位置开始计算。
<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,"this is a test1!\nthis is a test2!\nthis is a test3!\n"); Paragraphs paragraphs = baseText.getParagraphs(); paragraphs.clearFormats(0,1); </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> - 当指定区域中存在保护区域</DL>
</DD>
</DL>
<HR>

<A NAME="decreaseIndent()"><!-- --></A><H3>
decreaseIndent</H3>
<PRE>
public void <B>decreaseIndent</B>()</PRE>
<DL>
<DD>减少缩进。说明:如果这个段落集合是从章节的某个区域获得的,则对这个区域的所有段落减少缩进。 如果段落集合是从某个选取区域获得的,则缩进操作只对选取区域的段落有效。 <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(5,10); Paragraphs paragraphs = range.getParagraphs(); paragraphs.decreaseIndent(); </pre>
<P>
<DD><DL>

<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定区域中存在保护区域</DL>
</DD>
</DL>
<HR>

<A NAME="decreaseIndent(int, int)"><!-- --></A><H3>
decreaseIndent</H3>
<PRE>
public void <B>decreaseIndent</B>(int&nbsp;paragraphStartIndex,
                           int&nbsp;paragraphEndIndex)</PRE>
<DL>
<DD>减少缩进。说明:如果这个段落集合是从章节的某个区域获得的,则指定的段落索引从当前章节起始位置开始计算。 如果段落集合是从某个选取区域获得的,则指定的段落索引从选取区域起始位置开始计算。
<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,"this is a test1!\nthis is a test2!\nthis is a test3!\n"); Paragraphs paragraphs = baseText.getParagraphs(); paragraphs.decreaseIndent(0,1); </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> - 当指定区域中存在保护区域</DL>
</DD>
</DL>
<HR>

<A NAME="deleteParagraphs()"><!-- --></A><H3>
deleteParagraphs</H3>
<PRE>
public void <B>deleteParagraphs</B>()</PRE>
<DL>
<DD>删除段落文本(包括图像,域,多媒体等对象)。 说明:如果这个段落集合是从章节的某个区域获得的,则删除当前章节的所有段落。 如果段落集合是从某个选取区域获得的,则删除选取区域包含的所有段落。 <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.deleteParagraphs(); </pre>
<P>
<DD><DL>

<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定区域中存在保护区域</DL>
</DD>
</DL>
<HR>

<A NAME="deleteParagraphs(int, int)"><!-- --></A><H3>
deleteParagraphs</H3>
<PRE>
public void <B>deleteParagraphs</B>(int&nbsp;paragraphStartIndex,
                             int&nbsp;paragraphEndIndex)</PRE>
<DL>
<DD>删除段落文本(包括图像,域,多媒体等对象)。 说明:如果这个段落集合是从章节的某个区域获得的,则指定的段落索引从当前章节起始位置开始计算。 如果段落集合是从某个选取区域获得的,则指定的段落索引从选取区域起始位置开始计算。
<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,"this is a test1!\nthis is a test2!\nthis is a test3!\n"); Paragraphs paragraphs = baseText.getParagraphs(); paragraphs.deleteParagraphs(0,1); </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> - 当指定区域中存在保护区域</DL>
</DD>
</DL>
<HR>

<A NAME="formatStyle(int, int, application.workbooks.workbook.documents.document.styles.Style)"><!-- --></A><H3>
formatStyle</H3>
<PRE>
public void <B>formatStyle</B>(int&nbsp;paragraphStartIndex,
                        int&nbsp;paragraphEndIndex,
                        <A HREF="../../../../../application/workbooks/workbook/documents/document/styles/Style.html" title="application.workbooks.workbook.documents.document.styles 中的类">Style</A>&nbsp;style)</PRE>
<DL>
<DD>对指定段落开始索引号和结束索引号之间的段落字符串格式化其样式。 说明:如果这个段落集合是从章节的某个区域获得的,则指定的段落索引从当前章节起始位置开始计算。 如果段落集合是从某个选取区域获得的,则指定的段落索引从选取区域起始位置开始计算。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>paragraphStartIndex</CODE> - 格式化样式的段落开始索引号<DD><CODE>paragraphEndIndex</CODE> - 格式化样式的段落结束索引号<DD><CODE>style</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 test1!\nthis is a test2!\nthis is a test3!\n"); Paragraphs paragraphs = baseText.getParagraphs(); Styles styles = doc.getStyles(); Style style = styles.getStyle("标题 1"); paragraphs.formatStyle(0,1,style); </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/workbooks/workbook/documents/document/styles/Style.html" title="application.workbooks.workbook.documents.document.styles 中的类"><CODE>Style</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="formatStyle(application.workbooks.workbook.documents.document.styles.Style)"><!-- --></A><H3>
formatStyle</H3>
<PRE>
public void <B>formatStyle</B>(<A HREF="../../../../../application/workbooks/workbook/documents/document/styles/Style.html" title="application.workbooks.workbook.documents.document.styles 中的类">Style</A>&nbsp;style)</PRE>
<DL>
<DD>对指定段落开始索引号和结束索引号之间的段落字符串格式化其样式。 说明:如果这个段落集合是从章节的某个区域获得的,则对当前章节所有段落进行格式化操作。 如果段落集合是从某个选取区域获得的,则只对选取区域所包含的段落进行格式化操作。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>style</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 test1!\nthis is a test2!\nthis is a test3!\n"); TextRange range = baseText.getRange(10,15);

⌨️ 快捷键说明

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