📄 wpcomments.html
字号:
<b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); BaseText text = doc.getSection(0).getBaseText(); text.insertText(0,"this is a test!"); WpComments comments = doc.getComments(); Comment comment = comments.insert(0,3); comment.setText("新的批注信息"); comments.editComment(2); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 指定的offset小于0或大于文档长度</DL>
</DD>
</DL>
<HR>
<A NAME="getAllComments()"><!-- --></A><H3>
getAllComments</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/style/comment/Comment.html" title="application.workbooks.workbook.style.comment 中的类">Comment</A>[] <B>getAllComments</B>()</PRE>
<DL>
<DD>获得所有的批注对象。
<P>
<DD><DL>
<DT><B>返回:</B><DD>返回所有的批注对象 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); BaseText text = doc.getSection(0).getBaseText(); text.insertText(0,"this is a test!"); WpComments comments = doc.getComments(); Comment comment1 = comments.insert(0,3); comment1.setText("批注信息1"); Comment comment2 = comments.insert(4,3); comment2.setText("批注信息2"); Comment[] allcoments = comments.getAllComments(); for (int i = 0; i < allcoments.length; i++) { System.out.println("第"+i+"个批注的信息是:"+allcoments[i].getText()); } </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getComment(long)"><!-- --></A><H3>
getComment</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/style/comment/Comment.html" title="application.workbooks.workbook.style.comment 中的类">Comment</A> <B>getComment</B>(long offset)</PRE>
<DL>
<DD>返回指定偏移量的批注
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>offset</CODE> - 指定偏移量
<DT><B>返回:</B><DD>返回指定偏移量的批注 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); BaseText text = doc.getSection(0).getBaseText(); text.insertText(0,"this is a test!"); WpComments comments = doc.getComments(); Comment comment1 = comments.insert(0,3); comment1.setText("批注信息1"); Comment comment2 = comments.insert(4,3); comment2.setText("批注信息2"); Comment curcomment = comments.getComment(2); System.out.println("得到指定的批注信息是:"+curcomment.getText()); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 指定的offset小于0或大于文档长度</DL>
</DD>
</DL>
<HR>
<A NAME="getCount()"><!-- --></A><H3>
getCount</H3>
<PRE>
public int <B>getCount</B>()</PRE>
<DL>
<DD>获取批注对象在系统表中的个数。
<P>
<DD><DL>
<DT><B>返回:</B><DD>返回批注对象在系统表中的个数 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); BaseText text = doc.getSection(0).getBaseText(); text.insertText(0,"this is a test!"); WpComments comments = doc.getComments(); Comment comment1 = comments.insert(0,3); comment1.setText("批注信息1"); Comment comment2 = comments.insert(4,3); comment2.setText("批注信息2"); System.out.println("当前文档的批注数为:"+comments.getCount()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="insertComment(long, long)"><!-- --></A><H3>
insertComment</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/style/comment/Comment.html" title="application.workbooks.workbook.style.comment 中的类">Comment</A> <B>insertComment</B>(long offset,
long length)</PRE>
<DL>
<DD>插入批注。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>offset</CODE> - 批注的起始位置<DD><CODE>length</CODE> - 插入批注的长度 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); BaseText text = doc.getSection(0).getBaseText(); text.insertText(0,"this is a test!"); WpComments comments = doc.getComments(); Comment comment = comments.insertComment(0,3); comment.setText("新的批注信息"); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 指定的offset小于0或大于文档长度
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当length小于0或offset + length 大于文档长度<DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/documents/document/WpComments.html#deleteComment(long, long)"><CODE>deleteComment(long, long)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="next(long)"><!-- --></A><H3>
next</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/style/comment/Comment.html" title="application.workbooks.workbook.style.comment 中的类">Comment</A> <B>next</B>(long offset)</PRE>
<DL>
<DD>光标移动到下一个批注。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>offset</CODE> - 设置光标的起始位置 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); BaseText text = doc.getSection(0).getBaseText(); text.insertText(0,"this is a test!"); WpComments comments = doc.getComments(); Comment comment1 = comments.insert(5,3); comment1.setText("批注信息1"); Comment comment2 = comments.insert(9,3); comment2.setText("批注信息2"); Comment nextcomment = comments.next(2); System.out.println("后一个批注的信息是:"+nextcomment.getText()); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 指定的offset小于0或大于文档长度</DL>
</DD>
</DL>
<HR>
<A NAME="previous(long)"><!-- --></A><H3>
previous</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/style/comment/Comment.html" title="application.workbooks.workbook.style.comment 中的类">Comment</A> <B>previous</B>(long offset)</PRE>
<DL>
<DD>光标移动到上一个批注。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>offset</CODE> - 设置光标的起始位置 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); BaseText text = doc.getSection(0).getBaseText(); text.insertText(0,"this is a test!"); WpComments comments = doc.getComments(); Comment comment1 = comments.insert(0,3); comment1.setText("批注信息1"); Comment comment2 = comments.insert(4,3); comment2.setText("批注信息2"); Comment precomment = comments.previous(8); System.out.println("前一个批注的信息是:"+precomment.getText()); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 指定的offset小于0或大于文档长度</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> </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/documents/document/WordCount.html" title="application.workbooks.workbook.documents.document 中的类"><B>上一个类</B></A>
<A HREF="../../../../../application/workbooks/workbook/documents/document/WpPageSetup.html" title="application.workbooks.workbook.documents.document 中的类"><B>下一个类</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?application/workbooks/workbook/documents/document/WpComments.html" target="_top"><B>框架</B></A>
<A HREF="WpComments.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_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
版权所有 2001-2006 无锡永中科技有限公司
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -