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

📄 paragraph.html

📁 永中OFFICE二次开发帮助文档
💻 HTML
📖 第 1 页 / 共 5 页
字号:
getShadingAttribute</H3>
<PRE>
public <A HREF="../../../../../../application/workbooks/workbook/style/border/ShadingAttribute.html" title="application.workbooks.workbook.style.border 中的类">ShadingAttribute</A> <B>getShadingAttribute</B>()</PRE>
<DL>
<DD>获得当前段落的底纹属性。
<P>
<DD><DL>

<DT><B>返回:</B><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 test!\nthis is a test!\nthis is a test!"); Paragraph paragraph = baseText.getParagraphs().getFirst(); ShadingAttribute shadingAttr = new ShadingAttribute(); shadingAttr.setTextureIndex(8); paragraph.setShadingAttribute(shadingAttr); shadingAttr = paragraph.getShadingAttribute(); System.out.println("获得底纹属性的纹理索引为:" + shadingAttr.getTextureIndex()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../../application/workbooks/workbook/style/border/ShadingAttribute.html" title="application.workbooks.workbook.style.border 中的类"><CODE>ShadingAttribute</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getStartoffset()"><!-- --></A><H3>
getStartoffset</H3>
<PRE>
public long <B>getStartoffset</B>()</PRE>
<DL>
<DD>获得段落的起始位置,该位置为段落在全文中的位置。
<P>
<DD><DL>

<DT><B>返回:</B><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"); Paragraphs paragraphs = baseText.getParagraphs(); Paragraph paragraph = paragraphs.getFirst(); System.out.println("第一个段落的起始位置是:"+paragraph.getStartoffset()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getTabStops()"><!-- --></A><H3>
getTabStops</H3>
<PRE>
public <A HREF="../../../../../../application/workbooks/workbook/documents/document/TabStops.html" title="application.workbooks.workbook.documents.document 中的类">TabStops</A> <B>getTabStops</B>()</PRE>
<DL>
<DD>返回制表位的集合。
<P>
<DD><DL>

<DT><B>返回:</B><DD>TabStops类,用于管理制表位 <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(); Paragraph paragraph = paragraphs.getFirst(); TabStops tabstops = paragraph.getTabStops(); System.out.println("第一个段落的制表位集为:"+tabstops); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../../application/workbooks/workbook/documents/document/tabstops/package-summary.html"><CODE>application.workbooks.workbook.documents.document.tabstops</CODE></A>, 
<A HREF="../../../../../../application/workbooks/workbook/documents/document/tabstops/TabStop.html" title="application.workbooks.workbook.documents.document.tabstops 中的类"><CODE>TabStop</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getText()"><!-- --></A><H3>
getText</H3>
<PRE>
public java.lang.String <B>getText</B>()</PRE>
<DL>
<DD>获得段落的文本内容。
<P>
<DD><DL>

<DT><B>返回:</B><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"); Paragraphs paragraphs = baseText.getParagraphs(); Paragraph paragraph = paragraphs.getFirst(); System.out.println("第一个段落的内容是:"+paragraph.getText()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="nextParagraph()"><!-- --></A><H3>
nextParagraph</H3>
<PRE>
public <A HREF="../../../../../../application/workbooks/workbook/documents/document/paragraphs/Paragraph.html" title="application.workbooks.workbook.documents.document.paragraphs 中的类">Paragraph</A> <B>nextParagraph</B>()</PRE>
<DL>
<DD>得到当前段落的下一个段落。说明:如果当前段落是在页眉、页脚,那就只能在当前文本区域中查找段落,找不到则返回Null。
<P>
<DD><DL>

<DT><B>返回:</B><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"); Paragraphs paragraphs = baseText.getParagraphs(); Paragraph paragraph = paragraphs.getFirst(); Paragraph nextParagraph = paragraph.nextParagraph(); System.out.println("下一个段落的内容为:"+nextParagraph.getRange().getText()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="previousParagraph()"><!-- --></A><H3>
previousParagraph</H3>
<PRE>
public <A HREF="../../../../../../application/workbooks/workbook/documents/document/paragraphs/Paragraph.html" title="application.workbooks.workbook.documents.document.paragraphs 中的类">Paragraph</A> <B>previousParagraph</B>()</PRE>
<DL>
<DD>得到当前段落的上一个段落。说明:如果当前段落是在页眉、页脚中,那就只能在当前文本区域中查找段落,找不到则返回Null。
<P>
<DD><DL>

<DT><B>返回:</B><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"); Paragraphs paragraphs = baseText.getParagraphs(); Paragraph paragraph = paragraphs.getLast(); Paragraph preParagraph = paragraph.previousParagraph(); System.out.println("上一个段落的内容为:"+preParagraph.getRange().getText()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="setBorderAttribute(application.workbooks.workbook.style.border.BorderAttribute)"><!-- --></A><H3>
setBorderAttribute</H3>
<PRE>
public void <B>setBorderAttribute</B>(<A HREF="../../../../../../application/workbooks/workbook/style/border/BorderAttribute.html" title="application.workbooks.workbook.style.border 中的类">BorderAttribute</A>&nbsp;borderAttribute)</PRE>
<DL>
<DD>对当前段落设置段落边框。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>baseBorderAttribute</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(); Paragraph paragraph = paragraphs.getFirst(); BorderAttribute borderAttr = new BorderAttribute(); borderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_BOX); borderAttr.setBorderLineType(BorderAndShadingConstants.LEFT,0); borderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT,new java.awt.Color(255,0,0)); borderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT,0.75f); borderAttr.setBorderLineType(BorderAndShadingConstants.TOP,0); borderAttr.setBorderLineColor(BorderAndShadingConstants.TOP,new java.awt.Color(255,0,0)); borderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP,0.75f); borderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT,0); borderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT,new java.awt.Color(255,0,0)); borderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT,0.75f); borderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM,0); borderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM,new java.awt.Color(255,0,0)); borderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM,0.75f); paragraph.setBorderAttribute(borderAttr); </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/workbooks/workbook/style/border/BorderAttribute.html" title="application.workbooks.workbook.style.border 中的类"><CODE>BorderAttribute</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setColumn(application.workbooks.workbook.documents.document.Column)"><!-- --></A><H3>
setColumn</H3>
<PRE>
public void <B>setColumn</B>(<A HREF="../../../../../../application/workbooks/workbook/documents/document/Column.html" title="application.workbooks.workbook.documents.document 中的类">Column</A>&nbsp;column)</PRE>
<DL>
<DD>设置当前段落的分栏属性。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>column</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!\nthis is a test!\nthis is a test!"); Paragraph paragraph = baseText.getParagraphs().getParagraph(1); Column column = section.getColumn(); column.setCount(3); column.setEqualsWidth(false); column.setWidth(0, 100.0f); column.setWidth(1, 200.0f); column.setWidth(2, 100.0f); paragraph.setColumn(column); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定区域中存在保护区域</DL>
</DD>
</DL>
<HR>

<A NAME="setDropCap(application.workbooks.workbook.documents.document.paragraphs.DropCap)"><!-- --></A><H3>
setDropCap</H3>
<PRE>
public void <B>setDropCap</B>(<A HREF="../../../../../../application/workbooks/workbook/documents/document/paragraphs/DropCap.html" title="application.workbooks.workbook.documents.document.paragraphs 中的类">DropCap</A>&nbsp;dropCap)</PRE>
<DL>
<DD>给当前段落设置首字下沉属性。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>dropCap</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(); Paragraph paragraph = paragraphs.getFirst(); DropCap dropcap = paragraph.getDropCap(); dropcap.setPositionType(ParagraphConstants.POSITION_SUSPEND); dropcap.setDropLines(4); paragraph.setDropCap(dropcap); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="setFontAttribute(application.workbooks.workbook.style.font.FontAttribute)"><!-- --></A><H3>
setFontAttribute</H3>
<PRE>
public void <B>setFontAttribute</B>(<A HREF="../../../../../../application/workbooks/workbook/style/font/FontAttribute.html" title="application.workbooks.workbook.style.font 中的类">FontAttribute</A>&nbsp;fontAttribute)</PRE>
<DL>

⌨️ 快捷键说明

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