📄 cell.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0) on Fri Feb 29 09:23:21 CST 2008 -->
<META http-equiv="Content-Type" content="text/html; charset=GB2312">
<TITLE>
Cell (永中集成Office二次开发API文档)
</TITLE>
<META NAME="date" CONTENT="2008-02-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Cell (永中集成Office二次开发API文档)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="跳过导航链接"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>类</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
上一个类
<A HREF="../../../../application/workbooks/workbook/tables/CellAttribute.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/Cell.html" target="_top"><B>框架</B></A>
<A HREF="Cell.html" target="_top"><B>无框架</B></A>
<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">
摘要: 嵌套 | 字段 | 构造方法 | <A HREF="#method_summary">方法</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
详细信息: 字段 | 构造方法 | <A HREF="#method_detail">方法</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
application.workbooks.workbook.tables</FONT>
<BR>
类 Cell</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="继承者 "><B>application.workbooks.workbook.tables.Cell</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Cell</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
代表单个表格单元格。 <p> <p>
<P>
<P>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>方法摘要</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../application/workbooks/workbook/tables/Cell.html#delete(int)">delete</A></B>(int shiftCells)</CODE>
<BR>
删除当前指定的单元格。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../application/workbooks/workbook/style/border/BorderAttribute.html" title="application.workbooks.workbook.style.border 中的类">BorderAttribute</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../application/workbooks/workbook/tables/Cell.html#getBorderAttribute()">getBorderAttribute</A></B>()</CODE>
<BR>
得到表格单个单元格的边框属性。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../application/workbooks/workbook/tables/CellAttribute.html" title="application.workbooks.workbook.tables 中的类">CellAttribute</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../application/workbooks/workbook/tables/Cell.html#getCellAttribute()">getCellAttribute</A></B>()</CODE>
<BR>
得到单个指定单元格的属性。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../application/workbooks/workbook/documents/document/TextRange.html" title="application.workbooks.workbook.documents.document 中的类">TextRange</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../application/workbooks/workbook/tables/Cell.html#getRange()">getRange</A></B>()</CODE>
<BR>
得到单个表格单元格内的一个文本编辑区域。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../application/workbooks/workbook/tables/Row.html" title="application.workbooks.workbook.tables 中的类">Row</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../application/workbooks/workbook/tables/Cell.html#getRow()">getRow</A></B>()</CODE>
<BR>
获得当前单元格所在的行对象。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../application/workbooks/workbook/style/border/ShadingAttribute.html" title="application.workbooks.workbook.style.border 中的类">ShadingAttribute</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../application/workbooks/workbook/tables/Cell.html#getShadingAttribute()">getShadingAttribute</A></B>()</CODE>
<BR>
得到表格单个单元格的底纹属性。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../application/workbooks/workbook/tables/Cell.html#setBorderAttribute(application.workbooks.workbook.style.border.BorderAttribute)">setBorderAttribute</A></B>(<A HREF="../../../../application/workbooks/workbook/style/border/BorderAttribute.html" title="application.workbooks.workbook.style.border 中的类">BorderAttribute</A> borderAttribute)</CODE>
<BR>
设置表格单个单元格的边框属性。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../application/workbooks/workbook/tables/Cell.html#setCellAttribute(application.workbooks.workbook.tables.CellAttribute)">setCellAttribute</A></B>(<A HREF="../../../../application/workbooks/workbook/tables/CellAttribute.html" title="application.workbooks.workbook.tables 中的类">CellAttribute</A> cellAttribute)</CODE>
<BR>
设置指定单元格的单元格属性。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../application/workbooks/workbook/tables/Cell.html#setFormula(java.lang.String)">setFormula</A></B>(java.lang.String formula)</CODE>
<BR>
在指定单元格内插入表格计算的公式。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../application/workbooks/workbook/tables/Cell.html#setShadingAttribute(application.workbooks.workbook.style.border.ShadingAttribute)">setShadingAttribute</A></B>(<A HREF="../../../../application/workbooks/workbook/style/border/ShadingAttribute.html" title="application.workbooks.workbook.style.border 中的类">ShadingAttribute</A> shadingAttribute)</CODE>
<BR>
设置表格单个单元格的底纹属性。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../application/workbooks/workbook/tables/Cell.html#split(int, int)">split</A></B>(int row,
int column)</CODE>
<BR>
拆分表格单元格。</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>从类 java.lang.Object 继承的方法</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>方法详细信息</B></FONT></TH>
</TR>
</TABLE>
<A NAME="delete(int)"><!-- --></A><H3>
delete</H3>
<PRE>
public void <B>delete</B>(int shiftCells)</PRE>
<DL>
<DD>删除当前指定的单元格。单元格被删除后可选择控制如何移动剩余的单元格。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>shiftCells</CODE> - 单元格被删除后,其他活动单元格的补齐方式,只能取以下整型值之一: <pre> TableConstants.CELL_LEFTMOVE 右侧单元格左移 TableConstants.CELL_UPMOVE 下方单元格上移 TableConstants.CELL_DELROW 整行删除 TableConstants.CELL_DELCOL 整列删除 </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); cell.delete(TableConstants.CELL_LEFTMOVE); </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(); 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); BorderAttribute borderAttribute = cell.getBorderAttribute(); System.out.println("返回单个单元格边框的类型为:"+ borderAttribute.getBorderType()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/Cell.html#setBorderAttribute(application.workbooks.workbook.style.border.BorderAttribute)"><CODE>setBorderAttribute(BorderAttribute)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getCellAttribute()"><!-- --></A><H3>
getCellAttribute</H3>
<PRE>
public <A HREF="../../../../application/workbooks/workbook/tables/CellAttribute.html" title="application.workbooks.workbook.tables 中的类">CellAttribute</A> <B>getCellAttribute</B>()</PRE>
<DL>
<DD>得到单个指定单元格的属性。
<P>
<DD><DL>
<DT><B>返回:</B><DD>单元格属性 <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(); System.out.println("获得当前单元格垂直对齐方式:" + cellAttribute.getVerticalAlignment()); System.out.println("获得当前单元格是否可以自动换行:" + cellAttribute.isWordWrap()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/Cell.html#setCellAttribute(application.workbooks.workbook.tables.CellAttribute)"><CODE>setCellAttribute(CellAttribute)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getRange()"><!-- --></A><H3>
getRange</H3>
<PRE>
public <A HREF="../../../../application/workbooks/workbook/documents/document/TextRange.html" title="application.workbooks.workbook.documents.document 中的类">TextRange</A> <B>getRange</B>()</PRE>
<DL>
<DD>得到单个表格单元格内的一个文本编辑区域。
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -