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

📄 style.html

📁 永中OFFICE二次开发帮助文档
💻 HTML
📖 第 1 页 / 共 3 页
字号:
 Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); TabStop tabStop = new TabStop(1.5f,UnitConstants.CENTIMETER,TabStopConstants.RIGHT,TabStopConstants.DOTS); style.addTabStop(tabStop); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="addTabStops(application.workbooks.workbook.documents.document.tabstops.TabStop[])"><!-- --></A><H3>
addTabStops</H3>
<PRE>
public void <B>addTabStops</B>(<A HREF="../../../../../../application/workbooks/workbook/documents/document/tabstops/TabStop.html" title="application.workbooks.workbook.documents.document.tabstops 中的类">TabStop</A>[]&nbsp;tabstops)</PRE>
<DL>
<DD>添加多个制表位
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>tabstops</CODE> - 制表位对象数组 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("样式1"); Style style = styles.getStyle("样式1"); style.setStyleType(StyleConstants.STYLE_PARAGRAPH); style.setBaseStyle("正文"); style.setNextParagraphStyle("样式1"); style.addToTemplate(false); style.setAutoUpdate(false);  TabStop[] tabStop = new TabStop[2]; tabStop[0] = new TabStop(); tabStop[0].setPositionOfChar(1.2f); tabStop[0].setAlignment(TabStopConstants.ALIGNMENT_CENTER); tabStop[0].setLeader(TabStopConstants.DOTS); tabStop[1] = new TabStop(); tabStop[1].setPositionOfChar(2.3f); tabStop[1].setAlignment(TabStopConstants.ALIGNMENT_PERPENDICULAR); style.addTabStops(tabStop); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="addToTemplate()"><!-- --></A><H3>
addToTemplate</H3>
<PRE>
public void <B>addToTemplate</B>()</PRE>
<DL>
<DD>把当前样式加入到模板。 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); style.addToTemplate(); </pre>
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getBaseStyle()"><!-- --></A><H3>
getBaseStyle</H3>
<PRE>
public java.lang.String <B>getBaseStyle</B>()</PRE>
<DL>
<DD>获得基准样式的名字。
<P>
<DD><DL>

<DT><B>返回:</B><DD>基准样式的名字 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); style.setBaseStyle("标题 2");  System.out.println(style.getBaseStyle()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getBorderAttribute()"><!-- --></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>()</PRE>
<DL>
<DD>获得边框属性。
<P>
<DD><DL>

<DT><B>返回:</B><DD>边框属性 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); BorderAttribute borderAttr = new BorderAttribute(); borderAttr.setBordersApplyType(BorderAndShadingConstants.APPLY_PARAGRAPH); borderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW); borderAttr.setBorderLineType(BorderAndShadingConstants.LEFT,0); borderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT,0.5f); borderAttr.setBorderLineType(BorderAndShadingConstants.TOP,0); borderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP,1.5f); borderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT,0); borderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT,2.5f); borderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM,0); borderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM,3.5f); style.setBorderAttribute(borderAttr); System.out.println(styles.getStyle("new style").getBorderAttribute().getBorderType()); </pre><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="getFontAttribute()"><!-- --></A><H3>
getFontAttribute</H3>
<PRE>
public <A HREF="../../../../../../application/workbooks/workbook/style/font/FontAttribute.html" title="application.workbooks.workbook.style.font 中的类">FontAttribute</A> <B>getFontAttribute</B>()</PRE>
<DL>
<DD>获得文本字体属性。
<P>
<DD><DL>

<DT><B>返回:</B><DD>字体属性 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); FontAttribute fontAttribute = new  FontAttribute(); fontAttribute.setForeground(100,100,100); fontAttribute.setFontSize(14); fontAttribute.setUnderlineType(3); style.setFontAttribute(fontAttribute); System.out.println(styles.getStyle("new style").getFontAttribute().getForeground()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../../application/workbooks/workbook/style/font/FontAttribute.html" title="application.workbooks.workbook.style.font 中的类"><CODE>FontAttribute</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getName()"><!-- --></A><H3>
getName</H3>
<PRE>
public java.lang.String <B>getName</B>()</PRE>
<DL>
<DD>获得样式名字。
<P>
<DD><DL>

<DT><B>返回:</B><DD>样式名字 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); System.out.println(style.getName()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getNextParagraphStyle()"><!-- --></A><H3>
getNextParagraphStyle</H3>
<PRE>
public java.lang.String <B>getNextParagraphStyle</B>()</PRE>
<DL>
<DD>返回后续段落样式
<P>
<DD><DL>

<DT><B>返回:</B><DD>后续段落样式 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); style.setNextParagraphStyle("标题 2"); System.out.println(style.getNextParagraphStyle()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getParagraphAttribute()"><!-- --></A><H3>
getParagraphAttribute</H3>
<PRE>
public <A HREF="../../../../../../application/workbooks/workbook/style/paragraph/ParagraphAttribute.html" title="application.workbooks.workbook.style.paragraph 中的类">ParagraphAttribute</A> <B>getParagraphAttribute</B>()</PRE>
<DL>
<DD>获得段落属性。
<P>
<DD><DL>

<DT><B>返回:</B><DD>段落属性  <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); ParagraphAttribute paragraphAttribute = new ParagraphAttribute(); paragraphAttribute.setAlignment(ParagraphConstants.ALIGNMENT_CENTER); paragraphAttribute.setFirstLineIndent(3.8f,UnitConstants.POINT); style.setParagraphAttribute(paragraphAttribute); System.out.println(styles.getStyle("new style").getParagraphAttribute().getFirstLineIndent()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../../application/workbooks/workbook/style/paragraph/ParagraphAttribute.html" title="application.workbooks.workbook.style.paragraph 中的类"><CODE>ParagraphAttribute</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getShadingAttribute()"><!-- --></A><H3>
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(); Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); ShadingAttribute shadingAttribute = new ShadingAttribute(); shadingAttribute.setBackground(50,50,50); style.setShadingAttribute(shadingAttribute); System.out.println(style.getShadingAttribute()); </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="getStyleType()"><!-- --></A><H3>
getStyleType</H3>
<PRE>
public int <B>getStyleType</B>()</PRE>
<DL>
<DD>获得样式类型。
<P>
<DD><DL>

<DT><B>返回:</B><DD>样式类型 <pre> 常量如下; StyleConstants.STYLE_PARAGRAPH   表示段落样式 StyleConstants.STYLE_CHARACTER   表示字符样式 </pre> <p> <b>例子:</b> <pre>  Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); System.out.println("style type is : "+style.getStyleType()); style.setStyleType(StyleConstants.STYLE_CHARACTER); System.out.println("style type is : "+style.getStyleType()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../../application/constants/StyleConstants.html" title="application.constants 中的接口"><CODE>StyleConstants</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getTabStop(int)"><!-- --></A><H3>
getTabStop</H3>
<PRE>
public <A HREF="../../../../../../application/workbooks/workbook/documents/document/tabstops/TabStop.html" title="application.workbooks.workbook.documents.document.tabstops 中的类">TabStop</A> <B>getTabStop</B>(int&nbsp;index)</PRE>
<DL>
<DD>获取制表位。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>index</CODE> - 制表位的索引号,为整型数值 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); TabStop tabStop = new TabStop(1.5f,UnitConstants.CENTIMETER,TabStopConstants.ALIGNMENT_RIGHT,TabStopConstants.DOTS); style.addTabStop(tabStop); System.out.println(style.getTabStop(0)); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当参数index越界时</DL>
</DD>
</DL>
<HR>

<A NAME="isAddToTemplate()"><!-- --></A><H3>
isAddToTemplate</H3>
<PRE>
public boolean <B>isAddToTemplate</B>()</PRE>
<DL>
<DD>返回是否把当前样式加入模板。
<P>
<DD><DL>

<DT><B>返回:</B><DD>布尔型值,是否把新的样式加入模板。如果把新的样式加入模板,则返回true;否则,返回false <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); System.out.println(style.isAddToTemplate()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="isAutoUpdate()"><!-- --></A><H3>
isAutoUpdate</H3>
<PRE>
public boolean <B>isAutoUpdate</B>()</PRE>
<DL>
<DD>获得自动更新样式。
<P>
<DD><DL>

<DT><B>返回:</B><DD>布尔型值,是否自动更新样式。如果自动更新样式,则返回true;否则返回false <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Styles styles = doc.getStyles(); styles.addStyle("new style"); Style style = styles.getStyle("new style"); style.setAutoUpdate(true); System.out.println(style.isAutoUpdate()); </pre></DL>
</DD>
</DL>

⌨️ 快捷键说明

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