📄 wordbulletlevel.html
字号:
</DD>
</DL>
<HR>
<A NAME="getTextPosition()"><!-- --></A><H3>
getTextPosition</H3>
<PRE>
public float <B>getTextPosition</B>()</PRE>
<DL>
<DD>获取编号后文本位置(默认取磅值)。
<P>
<DD><DL>
<DT><B>返回:</B><DD>编号后文本位置,范围在-1584到1584磅之间 说明:get方法默认返回为磅值,如果要用其他的度量单位(英寸、厘米、毫米、十二点活字),可以用 application.util.Utilities.pointToOther(double, 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!\nthis is a test!\nthis is a test!\n"); WordBulletLevel bullet = baseText.getWordBulletLevel(BulletNumberConstants.LIST_NUMBER,1); baseText.setBulletedNumber(2,6,bullet,false); System.out.println("当前编号后文本位置为:"+bullet.getTextPosition()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getTrailingCharacter()"><!-- --></A><H3>
getTrailingCharacter</H3>
<PRE>
public int <B>getTrailingCharacter</B>()</PRE>
<DL>
<DD>获得编号之后间隙的类型,只有多级编号才有效。
<P>
<DD><DL>
<DT><B>返回:</B><DD>编号与文本间隙的类型,只能取以下3种类型之一: <pre> BulletNumberConstants.FOLLOW_TAB = 0 编号之后:制表符 BulletNumberConstants.FOLLOW_SPACE = 1 编号之后:空格 BulletNumberConstants.FOLLOW_NOTHING = 2 编号之后:不特别标注 </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!\nthis is a test!\nthis is a test!\n"); WordBulletLevel[] levels = baseText.getBulletLevelArray(1); baseText.setOutlinedNumber(2,30,levels,false); System.out.println("级别1的编号之后间隙的类型为:"+levels[0].getTrailingCharacter()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getType()"><!-- --></A><H3>
getType</H3>
<PRE>
public int <B>getType</B>()</PRE>
<DL>
<DD>获取列表格式的类型。
<P>
<DD><DL>
<DT><B>返回:</B><DD>列表格式的类型,可以取以下三种之一: <pre> BulletNumberConstants.LIST_NONE = 0; 列表类型:"无" BulletNumberConstants.LIST_BULLET = 1; 列表类型:"项目符号" BulletNumberConstants.LIST_NUMBER = 2; 列表类型:"编号" BulletNumberConstants.LIST_OUTLINE = 3; 列表类型:"多级编号" </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!\nthis is a test!\nthis is a test!\n"); WordBulletLevel bullet = baseText.getWordBulletLevel(BulletNumberConstants.LIST_BULLET,1); System.out.println("获取列表格式的类型为:"+bullet.getType()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="isPicture()"><!-- --></A><H3>
isPicture</H3>
<PRE>
public boolean <B>isPicture</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!\n"); WordBulletLevel bullet = baseText.getWordBulletLevel(BulletNumberConstants.LIST_BULLET,1); bullet.setPicturePath("d:\\bullet1.jpg"); baseText.setBulletedNumber(2,6,bullet,false); System.out.println("当前项目符号为图片:"+bullet.isPicture()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="isReStart()"><!-- --></A><H3>
isReStart</H3>
<PRE>
public boolean <B>isReStart</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!\n"); WordBulletLevel[] levels = baseText.getBulletLevelArray(1); levels[0].setReStart(true); baseText.setOutlinedNumber(2,30,levels,false); System.out.println("级别1的是否重新编号标记:"+levels[0].isReStart()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="isStandardStyle()"><!-- --></A><H3>
isStandardStyle</H3>
<PRE>
public boolean <B>isStandardStyle</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!\n"); WordBulletLevel[] levels = baseText.getBulletLevelArray(1); baseText.setOutlinedNumber(2,30,levels,false); System.out.println("级别1的是否为正规样式编号:"+levels[0].isStandardStyle()); </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> fontAttribute)</PRE>
<DL>
<DD>设置编号字体的属性。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>fontAttribute</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!\n"); WordBulletLevel bullet = baseText.getWordBulletLevel(BulletNumberConstants.LIST_NUMBER,1); FontAttribute fontAttr = new FontAttribute(); fontAttr.setBold(true); fontAttr.setFontSize(18); bullet.setFontAttribute(fontAttr); baseText.setBulletedNumber(2,6,bullet,false); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 字体格式为null</DL>
</DD>
</DL>
<HR>
<A NAME="setLevelText(java.lang.String)"><!-- --></A><H3>
setLevelText</H3>
<PRE>
public void <B>setLevelText</B>(java.lang.String text)</PRE>
<DL>
<DD>修改当前的编号格式。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>text</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!\n"); WordBulletLevel bullet = baseText.getWordBulletLevel(BulletNumberConstants.LIST_NUMBER,1); bullet.setLevelText("%1)"); baseText.setBulletedNumber(2,30,bullet,false); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 编号格式为null或""
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 编号格式字符个数超过30</DL>
</DD>
</DL>
<HR>
<A NAME="setLinkedStyle(int)"><!-- --></A><H3>
setLinkedStyle</H3>
<PRE>
public void <B>setLinkedStyle</B>(int styleID)</PRE>
<DL>
<DD>设置链接级别到样式,只有多级编号才有效。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>styleID</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!\n"); WordBulletLevel[] levels = baseText.getBulletLevelArray(1); levels[0].setLinkedStyle(4); baseText.setOutlinedNumber(2,30,levels,false); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 应用于类型不是多级编号的列表对象</DL>
</DD>
</DL>
<HR>
<A NAME="setNumberAlignment(int)"><!-- --></A><H3>
setNumberAlignment</H3>
<PRE>
public void <B>setNumberAlignment</B>(int alignment)</PRE>
<DL>
<DD>设置编号对齐位置。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>alignment</CODE> - 编号对齐类型,其常量和相应的值如下: <pre> BulletNumberConstants.LEFT = 0(编号位置左对齐); BulletNumberConstants.CENTER = 1(编号位置居中); BulletNumberConstants.RIGHT = 2(编号位置右对齐) <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!\n"); WordBulletLevel bullet = baseText.getWordBulletLevel(BulletNumberConstants.LIST_NUMBER,1); bullet.setNumberAlignment(BulletNumberConstants.CENTER); baseText.setBulletedNumber(2,6,bullet,false); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 指定的对齐类型不存在</DL>
</DD>
</DL>
<HR>
<A NAME="setNumberFormat(java.lang.String, int, int)"><!-- --></A><H3>
setNumberFormat</H3>
<PRE>
public void <B>setNumberFormat</B>(java.lang.String text,
int offset,
int length)</PRE>
<DL>
<DD>修改当前的编号格式。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>text</CODE> - 编号格式的新内容<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!\n"); WordBulletLevel bullet = baseText.getWordBulletLevel(BulletNumberConstants.LIST_NUMBER,1); bullet.setNumberFormat("&",0,0); bullet.setNumberFormat("@",2,0); baseText.setBulletedNumber(2,30,bullet,false); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 编号格式的新内容为null
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - offset小于文档起始位置或大于文本长度
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - length小于0或offset+length大于文本长度</DL>
</DD>
</DL>
<HR>
<A NAME="setNumberPosition(float)"><!-- --></A><H3>
setNumberPosition</H3>
<PRE>
public void <B>setNumberPosition</B>(float pos)</PRE>
<DL>
<DD>设置编号缩进位置(默认取磅值)。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>pos</CODE> - 编号缩进位置,范围在-1584到1584磅之间 说明:set方法的参数默认取磅值,如果要用其他的度量单位(英寸、厘米、毫米、十二点活字), 可以用 application.util.Utilities.otherToPoint(double, 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!\nthis is a test!\nthis is a test!\n"); WordBulletLevel bullet = baseText.getWordBulletLevel(BulletNumberConstants.LIST_NUMBER,1); bullet.setNumberPosition(1.5f); baseText.setBulletedNumber(2,6,bullet,false); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当编号缩进位置参数越界</DL>
</DD>
</DL>
<HR>
<A NAME="setNumberStyle(int)"><!-- --></A><H3>
setNumberStyle</H3>
<PRE>
public void <B>setNumberStyle</B>(int bnType)</PRE>
<DL>
<DD>设置编号样式。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>bnStyle</CODE> - 编号样式索引号,从0开始算起 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -