📄 findreplace.html
字号:
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#setFormat(boolean)"><CODE>setFormat(boolean)</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#clearFormat()"><CODE>clearFormat()</CODE></A>,
<CODE>application.constants.FindConstants.java</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="setMatchByte(boolean)"><!-- --></A><H3>
setMatchByte</H3>
<PRE>
public void <B>setMatchByte</B>(boolean matchByte)</PRE>
<DL>
<DD>区分全角和半角
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>matchByte</CODE> - 区分全角和半角(true :区分,false :不区分) <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); FindReplace finding = new FindReplace(); finding.clearFormat(); finding.setText("永中OFFICE"); finding.setForward(true); finding.setFormat(true); finding.setMatchByte(true); Replacement replacement = new Replacement(); replacement.clearFormat(); replacement.setText("office"); finding.setReplacement(replacement); baseText.replace(finding); Replacement replace = finding.getReplacement(); System.out.println("替换文本为:" + replace.getText()); System.out.println("替换文本是否粗体:" + replace.getFont().isBold()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="setMatchCase(boolean)"><!-- --></A><H3>
setMatchCase</H3>
<PRE>
public void <B>setMatchCase</B>(boolean matchCase)</PRE>
<DL>
<DD>设置查找过程中是否区分大小写。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>matchCase</CODE> - 布尔型值,如为true,查找时区分大小写;否则,查找时不区分大小写 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); FindReplace finding = new FindReplace(); finding.clearFormat(); finding.setText("office EIO"); finding.setForward(true); finding.setMatchCase(true); baseText.find(finding); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#getMatchCase()"><CODE>getMatchCase()</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#clearFormat()"><CODE>clearFormat()</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#setText(java.lang.String)"><CODE>setText(String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setMatchWholeWord(boolean)"><!-- --></A><H3>
setMatchWholeWord</H3>
<PRE>
public void <B>setMatchWholeWord</B>(boolean matchWholeWord)</PRE>
<DL>
<DD>设置查找过程中查找的单词是否完全匹配。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>matchWholeWord</CODE> - 布尔型值,如为true,查找时整个单词匹配;否则,查找时不整个单词匹配 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); FindReplace finding = new FindReplace(); finding.clearFormat(); finding.setText("office EIO"); finding.setForward(true); finding.setMatchWholeWord(true); baseText.find(finding); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#getMatchWholeWord()"><CODE>getMatchWholeWord()</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#clearFormat()"><CODE>clearFormat()</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#setText(java.lang.String)"><CODE>setText(String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setMatchWildcards(boolean)"><!-- --></A><H3>
setMatchWildcards</H3>
<PRE>
public void <B>setMatchWildcards</B>(boolean matchWildcards)</PRE>
<DL>
<DD>设置查找过程中查找的单词是否可以使用通配符。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>matchWildcards</CODE> - 布尔型值,如为true,查找过程中可以使用通配符;否则,查找过程中不使用通配符 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); FindReplace finding = new FindReplace(); finding.clearFormat(); finding.setText("*eio"); finding.setForward(true); finding.setMatchWildcards(true); baseText.find(finding); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#getMatchWildcards()"><CODE>getMatchWildcards()</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#clearFormat()"><CODE>clearFormat()</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#setText(java.lang.String)"><CODE>setText(String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setParagraphAttribute(application.workbooks.workbook.style.paragraph.ParagraphAttribute)"><!-- --></A><H3>
setParagraphAttribute</H3>
<PRE>
public void <B>setParagraphAttribute</B>(<A HREF="../../../../../application/workbooks/workbook/style/paragraph/ParagraphAttribute.html" title="application.workbooks.workbook.style.paragraph 中的类">ParagraphAttribute</A> paragraphAttribute)</PRE>
<DL>
<DD>设置查找或替换文本的段落格式。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>paragraphAttribute</CODE> - 查找或替换文本的段落格式 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); FindReplace finding = new FindReplace(); finding.clearFormat(); finding.setText("永中OFFICE"); ParagraphAttribute paraAttribute = new ParagraphAttribute(); paraAttribute.setAlignment(ParagraphConstants.ALIGNMENT_LEFT); paraAttribute.setLeftIndent(5.0f); finding.setParagraph(paraAttribute); finding.setForward(true); finding.setFormat(true); baseText.find(finding); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#setFormat(boolean)"><CODE>setFormat(boolean)</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#clearFormat()"><CODE>clearFormat()</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#setText(java.lang.String)"><CODE>setText(String)</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#setFont(application.workbooks.workbook.style.font.FontAttribute)"><CODE>setFont(FontAttribute)</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#setStyle(java.lang.String)"><CODE>setStyle(String)</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/style/paragraph/ParagraphAttribute.html" title="application.workbooks.workbook.style.paragraph 中的类"><CODE>ParagraphAttribute</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setReplacement(application.workbooks.workbook.documents.document.Replacement)"><!-- --></A><H3>
setReplacement</H3>
<PRE>
public void <B>setReplacement</B>(<A HREF="../../../../../application/workbooks/workbook/documents/document/Replacement.html" title="application.workbooks.workbook.documents.document 中的类">Replacement</A> replacement)</PRE>
<DL>
<DD>设置替换文本时的替换文本属性。 (注:不仅可以把文本内容替换掉,还可以把文本属性(字体或段落格式或样式等)替换掉。)
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>replacement</CODE> - 替换文本时的替换文本属性 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); FindReplace finding = new FindReplace(); finding.clearFormat(); finding.setText("永中OFFICE"); finding.setForward(true); finding.setFormat(true); Replacement replacement = new Replacement(); replacement.clearFormat(); replacement.setText("office"); finding.setReplacement(replacement); baseText.replace(finding); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#getReplacement()"><CODE>getReplacement()</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#setFormat(boolean)"><CODE>setFormat(boolean)</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#clearFormat()"><CODE>clearFormat()</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/Replacement.html" title="application.workbooks.workbook.documents.document 中的类"><CODE>Replacement</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setStyle(java.lang.String)"><!-- --></A><H3>
setStyle</H3>
<PRE>
public void <B>setStyle</B>(java.lang.String styleName)</PRE>
<DL>
<DD>设置查找或替换文本的样式。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>styleName</CODE> - 查找或替换文本的样式 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); FindReplace finding = new FindReplace(); finding.clearFormat(); finding.setText("永中OFFICE"); finding.setStyle("标题 1"); finding.setForward(true); finding.setFormat(true); baseText.find(finding); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#getStyle()"><CODE>getStyle()</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#setFormat(boolean)"><CODE>setFormat(boolean)</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#clearFormat()"><CODE>clearFormat()</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#setText(java.lang.String)"><CODE>setText(String)</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#setFont(application.workbooks.workbook.style.font.FontAttribute)"><CODE>setFont(FontAttribute)</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#setParagraph(application.workbooks.workbook.style.paragraph.ParagraphAttribute)"><CODE>setParagraph(ParagraphAttribute)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setText(java.lang.String)"><!-- --></A><H3>
setText</H3>
<PRE>
public void <B>setText</B>(java.lang.String findString)</PRE>
<DL>
<DD>设置要查找的内容。 (注:要查找就必须初始化FindReplace类。)
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>findString</CODE> - 需要查找的字符串 <p> <b>例子:</b> <pre> //请输入一些文字 Document doc = Application.getWorkbooks().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); FindReplace finding = new FindReplace(); finding.clearFormat(); finding.setText("永中OFFICE"); baseText.find(finding); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#getText()"><CODE>getText()</CODE></A>,
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindReplace.html#clearFormat()"><CODE>clearFormat()</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> </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/Fields.html" title="application.workbooks.workbook.documents.document 中的类"><B>上一个类</B></A>
<A HREF="../../../../../application/workbooks/workbook/documents/document/FindResult.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/FindReplace.html" target="_top"><B>框架</B></A>
<A HREF="FindReplace.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 + -