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

📄 dropcap.html

📁 永中OFFICE二次开发帮助文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
 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(); System.out.println("当前段落首字下沉行数为:"+dropcap.getDropLines()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getFontName()"><!-- --></A><H3>
getFontName</H3>
<PRE>
public java.lang.String <B>getFontName</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(); DropCap dropcap = paragraph.getDropCap(); System.out.println("当前段落首字下沉字体为:"+dropcap.getFontName()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getPositionType()"><!-- --></A><H3>
getPositionType</H3>
<PRE>
public int <B>getPositionType</B>()</PRE>
<DL>
<DD>得到当前段落首字下沉的位置类型。
<P>
<DD><DL>

<DT><B>返回:</B><DD>首字下沉的位置类型,只能取下面值之一: <pre> ParagraphConstants.POSITION_NONE     无下沉 ParagraphConstants.POSITION_DROP     下沉方式 ParagraphConstants.POSITION_SUSPEND  悬挂方式 </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 test1!\nthis is a test2!\nthis is a test3!\n"); Paragraphs paragraphs = baseText.getParagraphs(); Paragraph paragraph = paragraphs.getFirst(); DropCap dropcap = paragraph.getDropCap(); System.out.println("当前段落首字下沉位置为:"+dropcap.getPositionType()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="setDistanceFromText(float)"><!-- --></A><H3>
setDistanceFromText</H3>
<PRE>
public void <B>setDistanceFromText</B>(float&nbsp;distance)</PRE>
<DL>
<DD>设置当前段落首字下沉的距正文的宽度(取磅为默认单位)。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>distance</CODE> - 距正文的宽度,单位为磅值,只能取0~1584磅 <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_DROP); dropcap.setDistanceFromText(100.0f); paragraph.setDropCap(dropcap); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当距正文宽度数值越界</DL>
</DD>
</DL>
<HR>

<A NAME="setDropLines(int)"><!-- --></A><H3>
setDropLines</H3>
<PRE>
public void <B>setDropLines</B>(int&nbsp;linesNum)</PRE>
<DL>
<DD>设置当前段落首字下沉的下沉行数。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>linesNum</CODE> - 首字下沉行数,只能取1~10的整数 <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_DROP); dropcap.setDropLines(4); paragraph.setDropCap(dropcap); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当下沉行数数值越界</DL>
</DD>
</DL>
<HR>

<A NAME="setFontName(java.lang.String)"><!-- --></A><H3>
setFontName</H3>
<PRE>
public void <B>setFontName</B>(java.lang.String&nbsp;fontName)</PRE>
<DL>
<DD>设置当前段落首字下沉的字体名字。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>fontName</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.setFontName("永中楷体"); paragraph.setDropCap(dropcap); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当下沉字符的字体为空或不能使用</DL>
</DD>
</DL>
<HR>

<A NAME="setPositionType(int)"><!-- --></A><H3>
setPositionType</H3>
<PRE>
public void <B>setPositionType</B>(int&nbsp;type)</PRE>
<DL>
<DD>设置当前段落首字下沉的位置类型。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>type</CODE> - 首字下沉的位置类型,只能取下面值之一: <pre> ParagraphConstants.POSITION_NONE     无下沉 ParagraphConstants.POSITION_DROP     下沉方式 ParagraphConstants.POSITION_SUSPEND  悬挂方式 </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 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); paragraph.setDropCap(dropcap); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当下沉位置类型常量不存在</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="跳过导航链接"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>类</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;上一个类&nbsp;
&nbsp;<A HREF="../../../../../../application/workbooks/workbook/documents/document/paragraphs/Paragraph.html" title="application.workbooks.workbook.documents.document.paragraphs 中的类"><B>下一个类</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?application/workbooks/workbook/documents/document/paragraphs/DropCap.html" target="_top"><B>框架</B></A>  &nbsp;
&nbsp;<A HREF="DropCap.html" target="_top"><B>无框架</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>所有类</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>所有类</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  摘要:&nbsp;嵌套&nbsp;|&nbsp;字段&nbsp;|&nbsp;构造方法&nbsp;|&nbsp;<A HREF="#method_summary">方法</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
详细信息:&nbsp;字段&nbsp;|&nbsp;构造方法&nbsp;|&nbsp;<A HREF="#method_detail">方法</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
版权所有 2001-2006 无锡永中科技有限公司
</BODY>
</HTML>

⌨️ 快捷键说明

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