📄 documents.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:19 CST 2008 -->
<META http-equiv="Content-Type" content="text/html; charset=GB2312">
<TITLE>
Documents (永中集成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="Documents (永中集成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/CustomFileProperties.html" title="application.workbooks.workbook 中的类"><B>上一个类</B></A>
<A HREF="../../../application/workbooks/workbook/FileProperties.html" title="application.workbooks.workbook 中的类"><B>下一个类</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?application/workbooks/workbook/Documents.html" target="_top"><B>框架</B></A>
<A HREF="Documents.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</FONT>
<BR>
类 Documents</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="继承者 "><B>application.workbooks.workbook.Documents</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Documents</B><DT>extends java.lang.Object</DL>
</PRE>
<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> <A HREF="../../../application/workbooks/workbook/documents/Document.html" title="application.workbooks.workbook.documents 中的类">Document</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../application/workbooks/workbook/Documents.html#addDocument()">addDocument</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.html" title="application.workbooks.workbook.documents 中的类">Document</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../application/workbooks/workbook/Documents.html#addDocument(java.lang.String)">addDocument</A></B>(java.lang.String name)</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/Documents.html#clearDifference()">clearDifference</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/Documents.html#closeDocument(java.lang.String)">closeDocument</A></B>(java.lang.String name)</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/Documents.html#compareDocument(application.workbooks.workbook.documents.Document, application.workbooks.workbook.documents.Document, java.awt.Color)">compareDocument</A></B>(<A HREF="../../../application/workbooks/workbook/documents/Document.html" title="application.workbooks.workbook.documents 中的类">Document</A> doc1,
<A HREF="../../../application/workbooks/workbook/documents/Document.html" title="application.workbooks.workbook.documents 中的类">Document</A> doc2,
java.awt.Color color)</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.html" title="application.workbooks.workbook.documents 中的类">Document</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../application/workbooks/workbook/Documents.html#getActiveDocument()">getActiveDocument</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.html" title="application.workbooks.workbook.documents 中的类">Document</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../application/workbooks/workbook/Documents.html#getAllDocuments()">getAllDocuments</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.html" title="application.workbooks.workbook.documents 中的类">Document</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../application/workbooks/workbook/Documents.html#getDocument(java.lang.String)">getDocument</A></B>(java.lang.String name)</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.html" title="application.workbooks.workbook.documents 中的类">Document</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../application/workbooks/workbook/Documents.html#openDocument(java.lang.String)">openDocument</A></B>(java.lang.String name)</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/Documents.html#removeDocument(java.lang.String)">removeDocument</A></B>(java.lang.String name)</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.html" title="application.workbooks.workbook.documents 中的类">Document</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../application/workbooks/workbook/Documents.html#rename(java.lang.String, java.lang.String)">rename</A></B>(java.lang.String oldName,
java.lang.String newName)</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="addDocument()"><!-- --></A><H3>
addDocument</H3>
<PRE>
public <A HREF="../../../application/workbooks/workbook/documents/Document.html" title="application.workbooks.workbook.documents 中的类">Document</A> <B>addDocument</B>()</PRE>
<DL>
<DD>添加一个默认格式的文字处理文档。
<P>
<DD><DL>
<DT><B>返回:</B><DD>新建的文字处理文档。 <p> <b>例子: </b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().addDocument(); System.out.println("新增文档的名字是:" + doc.getName()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../application/workbooks/workbook/Documents.html#getDocument(java.lang.String)"><CODE>getDocument(String)</CODE></A>,
<A HREF="../../../application/workbooks/workbook/Documents.html#removeDocument(java.lang.String)"><CODE>removeDocument(String)</CODE></A>,
<A HREF="../../../application/workbooks/workbook/Documents.html#rename(java.lang.String, java.lang.String)"><CODE>rename(String,String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="addDocument(java.lang.String)"><!-- --></A><H3>
addDocument</H3>
<PRE>
public <A HREF="../../../application/workbooks/workbook/documents/Document.html" title="application.workbooks.workbook.documents 中的类">Document</A> <B>addDocument</B>(java.lang.String name)</PRE>
<DL>
<DD>添加一个文字处理文档。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>name</CODE> - 需要添加的文字处理文档的名字。
<DT><B>返回:</B><DD>新建的文字处理文档 <p> <b>例子: </b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().addDocument("我的文档"); BaseText baseText = doc.getSection(0).getBaseText(); baseText.insertText(0,"this is a test!\nthis is a test!\nthis is a test!"); System.out.println("新增文档的内容是:"+baseText.getText(0,baseText.getTextLength())); </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/Documents.html#getDocument(java.lang.String)"><CODE>getDocument(String)</CODE></A>,
<A HREF="../../../application/workbooks/workbook/Documents.html#removeDocument(java.lang.String)"><CODE>removeDocument(String)</CODE></A>,
<A HREF="../../../application/workbooks/workbook/Documents.html#rename(java.lang.String, java.lang.String)"><CODE>rename(String,String)</CODE></A>,
<A HREF="../../../application/workbooks/workbook/documents/Document.html" title="application.workbooks.workbook.documents 中的类"><CODE>Document</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="clearDifference()"><!-- --></A><H3>
clearDifference</H3>
<PRE>
public void <B>clearDifference</B>()</PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -