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

📄 cellattribute.html

📁 永中OFFICE二次开发帮助文档
💻 HTML
📖 第 1 页 / 共 3 页
字号:
 Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); application.workbooks.workbook.tables.Cell cell = table.getCell(2,3); CellAttribute cellAttribute = cell.getCellAttribute(); cellAttribute.setCellMarginSameAsTable(true); cell.setCellAttribute(cellAttribute); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/CellAttribute.html#isCellMarginSameAsTable()"><CODE>isCellMarginSameAsTable()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setLeftMargin(float)"><!-- --></A><H3>
setLeftMargin</H3>
<PRE>
public void <B>setLeftMargin</B>(float&nbsp;margin)</PRE>
<DL>
<DD>设置当前单元格左边距。说明:边距的范围为0~1584磅。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>margin</CODE> - 单元格左边距(单位为磅值) <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); application.workbooks.workbook.tables.Cell cell = table.getCell(2,3); CellAttribute cellAttribute = cell.getCellAttribute(); cellAttribute.setCellMarginSameAsTable(false); cellAttribute.setLeftMargin(30.0f); cell.setCellAttribute(cellAttribute); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定边距超出范围0~1584磅</DL>
</DD>
</DL>
<HR>

<A NAME="setPreferredWidth(float)"><!-- --></A><H3>
setPreferredWidth</H3>
<PRE>
public void <B>setPreferredWidth</B>(float&nbsp;width)</PRE>
<DL>
<DD>设置指定单元格的宽度。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>width</CODE> - 指定单元格的宽度 说明:单元格宽度的度量类型不同,单元格宽度值的语义也不一样。如果,度量类型为固定值,则返回单元格宽度为磅值,范围在0~1584磅; 如果度量类型为百分比,则返回单元格宽度是一个相对值,范围在0~100%。 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); application.workbooks.workbook.tables.Cell cell = table.getCell(2,3); CellAttribute cellAttribute = cell.getCellAttribute(); cellAttribute.setPreferredWidthMeasure(TableConstants.CELL_WIDTH_MEASURE); cellAttribute.setPreferredWidth(40.0f); cell.setCellAttribute(cellAttribute); </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/tables/CellAttribute.html#getPreferredWidth()"><CODE>getPreferredWidth()</CODE></A>, 
<A HREF="../../../../application/workbooks/workbook/tables/CellAttribute.html#setPreferredWidthMeasure(int)"><CODE>setPreferredWidthMeasure(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setPreferredWidthMeasure(int)"><!-- --></A><H3>
setPreferredWidthMeasure</H3>
<PRE>
public void <B>setPreferredWidthMeasure</B>(int&nbsp;widthType)</PRE>
<DL>
<DD>设置指定单元格宽度的度量方式。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>widthType</CODE> - 单元格宽度的度量方式,只能取以下值之一: <pre> TableConstants.CELL_WIDTH_NONE_SET  不指定单元格宽度 TableConstants.CELL_WIDTH_MEASURE   指定宽度为绝对值 TableConstants.CELL_WIDTH_PRECENT   指定宽度为百分比 </pre> <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); application.workbooks.workbook.tables.Cell cell = table.getCell(2,3); CellAttribute cellAttribute = cell.getCellAttribute(); cellAttribute.setPreferredWidthMeasure(TableConstants.CELL_WIDTH_PRECENT); cellAttribute.setPreferredWidth(40.0f); cell.setCellAttribute(cellAttribute); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定单元格宽度的度量方式常量不存在<DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/CellAttribute.html#getPreferredWidthMeasure()"><CODE>getPreferredWidthMeasure()</CODE></A>, 
<A HREF="../../../../application/workbooks/workbook/tables/CellAttribute.html#setPreferredWidth(float)"><CODE>setPreferredWidth(float)</CODE></A>, 
<A HREF="../../../../application/constants/TableConstants.html" title="application.constants 中的接口"><CODE>TableConstants</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setRightMargin(float)"><!-- --></A><H3>
setRightMargin</H3>
<PRE>
public void <B>setRightMargin</B>(float&nbsp;margin)</PRE>
<DL>
<DD>设置当前单元格右边距。说明:边距的范围为0~1584磅。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>margin</CODE> - 单元格右边距(单位为磅值) <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); application.workbooks.workbook.tables.Cell cell = table.getCell(2,3); CellAttribute cellAttribute = cell.getCellAttribute(); cellAttribute.setCellMarginSameAsTable(false); cellAttribute.setRightMargin(30.0f); cell.setCellAttribute(cellAttribute); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定边距超出范围0~1584磅</DL>
</DD>
</DL>
<HR>

<A NAME="setTopMargin(float)"><!-- --></A><H3>
setTopMargin</H3>
<PRE>
public void <B>setTopMargin</B>(float&nbsp;margin)</PRE>
<DL>
<DD>设置当前单元格上边距。说明:边距的范围为0~1584磅。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>margin</CODE> - 单元格上边距(单位为磅值) <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); application.workbooks.workbook.tables.Cell cell = table.getCell(2,3); CellAttribute cellAttribute = cell.getCellAttribute(); cellAttribute.setCellMarginSameAsTable(false); cellAttribute.setTopMargin(30.0f); cell.setCellAttribute(cellAttribute); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定边距超出范围0~1584磅</DL>
</DD>
</DL>
<HR>

<A NAME="setVerticalAlignment(int)"><!-- --></A><H3>
setVerticalAlignment</H3>
<PRE>
public void <B>setVerticalAlignment</B>(int&nbsp;tableAlign)</PRE>
<DL>
<DD>设置单元格的垂直对齐方式。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>tableAlign</CODE> - 单元格的垂直对齐方式,只能取以下整形值之一: <pre> TableConstants.V_TOP = 0      顶端对齐 TableConstants.V_CENTER = 1   居中对齐   TableConstants.V_BOTTOM = 2   底端对齐 </pre>              <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); application.workbooks.workbook.tables.Cell cell = table.getCell(2,3); CellAttribute cellAttribute = cell.getCellAttribute(); cellAttribute.setVerticalAlignment(TableConstants.V_CENTER); cell.setCellAttribute(cellAttribute); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定单元格垂直对齐方式常量不存在<DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/CellAttribute.html#getVerticalAlignment()"><CODE>getVerticalAlignment()</CODE></A>, 
<A HREF="../../../../application/constants/TableConstants.html" title="application.constants 中的接口"><CODE>TableConstants</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setWordWrap(boolean)"><!-- --></A><H3>
setWordWrap</H3>
<PRE>
public void <B>setWordWrap</B>(boolean&nbsp;autoWrap)</PRE>
<DL>
<DD>设置当前单元格是否可以自动换行。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>autoWrap</CODE> - 如果为true,则可以自动换行 <p> <b>例子:</b> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); application.workbooks.workbook.tables.Cell cell = table.getCell(2,3); CellAttribute cellAttribute = cell.getCellAttribute(); cellAttribute.setWordWrap(false); cell.setCellAttribute(cellAttribute); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/CellAttribute.html#isWordWrap()"><CODE>isWordWrap()</CODE></A></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;<A HREF="../../../../application/workbooks/workbook/tables/Cell.html" title="application.workbooks.workbook.tables 中的类"><B>上一个类</B></A>&nbsp;
&nbsp;<A HREF="../../../../application/workbooks/workbook/tables/Cells.html" title="application.workbooks.workbook.tables 中的类"><B>下一个类</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?application/workbooks/workbook/tables/CellAttribute.html" target="_top"><B>框架</B></A>  &nbsp;
&nbsp;<A HREF="CellAttribute.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 + -