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

📄 abstracttext.html

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

<A NAME="cut(long, long)"><!-- --></A><H3>
cut</H3>
<PRE>
public void <B>cut</B>(long&nbsp;offset,
                long&nbsp;length)</PRE>
<DL>
<DD>在指定位置剪切指定长度的文本(包括图像,域,多媒体等对象)。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>offset</CODE> - 剪切时指定的起始位置(起始位置为0)<DD><CODE>length</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!"); baseText.cut(2,4); baseText.paste(0); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当offset小于0或大于文档长度。
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当offset + length 大于文档长度。
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定区域中存在保护区域</DL>
</DD>
</DL>
<HR>

<A NAME="decreaseIndent(long, long)"><!-- --></A><H3>
decreaseIndent</H3>
<PRE>
public void <B>decreaseIndent</B>(long&nbsp;offset,
                           long&nbsp;length)</PRE>
<DL>
<DD>减少缩进。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>offset</CODE> - 光标的起始位置<DD><CODE>length</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!"); baseText.decreaseIndent(2,6); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当offset小于0或大于文档长度。
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当offset + length 大于文档长度。
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定区域中存在保护区域</DL>
</DD>
</DL>
<HR>

<A NAME="delete(long, long)"><!-- --></A><H3>
delete</H3>
<PRE>
public void <B>delete</B>(long&nbsp;offset,
                   long&nbsp;length)</PRE>
<DL>
<DD>在指定位置删除指定长度的文本(包括图像,域,多媒体等对象)。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>offset</CODE> - 删除时光标指定的起始位置(起始位置为0)<DD><CODE>length</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!"); baseText.delete(2,6); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当offset小于0或大于文档长度。
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当offset + length 大于文档长度。
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定区域中存在保护区域</DL>
</DD>
</DL>
<HR>

<A NAME="deleteHyperlink(long)"><!-- --></A><H3>
deleteHyperlink</H3>
<PRE>
public void <B>deleteHyperlink</B>(long&nbsp;offset)</PRE>
<DL>
<DD>删除指定位置的超链接。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>offset</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!"); Hyperlink hyperlink = new Hyperlink(); hyperlink.setHyperlinkType(HyperlinkConstants.THIS_BINDER_POSITION); hyperlink.setShowText("this is a test!"); hyperlink.hyperlinkToCell("工作表1!A1"); baseText.insertHyperlink(3,6,hyperlink); baseText.deleteHyperlink(4); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当offset小于0或大于文档长度。
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当offset + length 大于文档长度。</DL>
</DD>
</DL>
<HR>

<A NAME="formatStyle(long, long, application.workbooks.workbook.documents.document.styles.Style)"><!-- --></A><H3>
formatStyle</H3>
<PRE>
public void <B>formatStyle</B>(long&nbsp;offset,
                        long&nbsp;length,
                        <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>offset</CODE> - 格式化样式的起始位置(起始位置为0)<DD><CODE>length</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 test!\nthis is a test!\nthis is a test!"); Styles styles = doc.getStyles(); Style style = styles.getStyle("标题 1"); baseText.formatStyle(2,10,style); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当offset小于0或大于文档长度。
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当offset + length 大于文档长度。
<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="getBorderAttribute(long)"><!-- --></A><H3>
getBorderAttribute</H3>
<PRE>
public <A HREF="../../../../../../application/workbooks/workbook/style/border/BorderAttribute.html" title="application.workbooks.workbook.style.border 中的类">BorderAttribute</A> <B>getBorderAttribute</B>(long&nbsp;offset)</PRE>
<DL>
<DD>获得指定位置的边框属性。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>offset</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(); baseText.insertText(0,"this is a test!\nthis is a test!\nthis is a test!"); BorderAttribute borderAttr = new BorderAttribute(); borderAttr.setApplyType(BorderAndShadingConstants.APPLY_TEXT);  borderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW); borderAttr.setBorderLineType(BorderAndShadingConstants.TOP,1); borderAttr.setBorderLineType(BorderAndShadingConstants.LEFT,3); borderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT,6); borderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM,8); borderAttr.setBorderLineColor(BorderAndShadingConstants.TOP,Color.RED); borderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT,Color.CYAN); borderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT,Color.YELLOW); borderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM,Color.ORANGE); borderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP,8f); borderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT,5f); borderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT,3f); borderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM,1f); baseText.setBorderAttribute(2,5,borderAttr); BorderAttribute border = baseText.getBorderAttribute(5); System.out.println("指定位置的字符边框的类型是:"+border.getBorderType()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getBulletLevel(long)"><!-- --></A><H3>
getBulletLevel</H3>
<PRE>
public <A HREF="../../../../../../application/workbooks/workbook/documents/document/WordBulletLevel.html" title="application.workbooks.workbook.documents.document 中的类">WordBulletLevel</A> <B>getBulletLevel</B>(long&nbsp;offset)</PRE>
<DL>
<DD>得到指定位置处的项目符号或编号信息。说明:如果指定位置处是多级编号,则返回这个多级编号列表中的某一级别的编号信息。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>offset</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(); baseText.insertText(0,"this is a test!\nthis is a test!\nthis is a test!"); WordBulletLevel bullet = doc.getWordBulletLevel(BulletNumberConstants.LIST_NUMBER,2); baseText.setBulletedNumber(0,10,bullet,false); WordBulletLevel bullet = baseText.getBulletLevel(4); System.out.println("bullet = "+bullet); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../../application/workbooks/workbook/documents/document/WordBulletLevel.html" title="application.workbooks.workbook.documents.document 中的类"><CODE>WordBulletLevel</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getBulletLevelArray(long)"><!-- --></A><H3>
getBulletLevelArray</H3>
<PRE>
public <A HREF="../../../../../../application/workbooks/workbook/documents/document/WordBulletLevel.html" title="application.workbooks.workbook.documents.document 中的类">WordBulletLevel</A>[] <B>getBulletLevelArray</B>(long&nbsp;offset)</PRE>
<DL>
<DD>得到指定位置处的项目符号或编号的列表。 说明:如果指定位置处是项目符号或编号,则此列表返回长度为1的项目符号或编号数组。 如果指定位置处是多级编号,则此列表为一长度为9的项目符号或编号数组。每一

⌨️ 快捷键说明

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