TextRange2.Replace(String, String, Int32, MsoTriState, MsoTriState) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
查找文本区域中的特定文本,将找到的文本替换为指定的字符串,并返回一个 TextRange2 对象,该对象表示找到的文本的第一个匹配项。 如果未找到匹配,则返回 Nothing 。
public Microsoft.Office.Core.TextRange2 Replace (string FindWhat, string ReplaceWhat, int After = 0, Microsoft.Office.Core.MsoTriState MatchCase = Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState WholeWords = Microsoft.Office.Core.MsoTriState.msoFalse);
abstract member Replace : string * string * int * Microsoft.Office.Core.MsoTriState * Microsoft.Office.Core.MsoTriState -> Microsoft.Office.Core.TextRange2
Public Function Replace (FindWhat As String, ReplaceWhat As String, Optional After As Integer = 0, Optional MatchCase As MsoTriState = Microsoft.Office.Core.MsoTriState.msoFalse, Optional WholeWords As MsoTriState = Microsoft.Office.Core.MsoTriState.msoFalse) As TextRange2
参数
- FindWhat
- String
要搜索的文本。
- ReplaceWhat
- String
用来替换查找到的文本的文本。
- After
- Int32
字符 (在指定文本范围中的位置) 之后搜索下一个匹配项 FindWhat
。 例如,如果要从文本范围的第五个字符进行搜索,请为 After
指定 4。 如果省略此参数,则将文本范围的第一个字符作为搜索的起点。
- MatchCase
- MsoTriState
确定是否区分大小写。
- WholeWords
- MsoTriState
确定是否仅搜索整个词。
返回
TextRange2