TextRange.Find 屬性 (Publisher)

從指定的 TextRange 物件傳回 FindReplace 物件。 FindReplace 物件用來執行文字搜尋與取代指定的文字範圍中。

語法

運算式。尋找

運算式 代表 TextRange 物件的變數。

範例

下列範例會將使用中文件的第一個圖案之文字範圍的 FindReplace 物件的物件變數。 執行搜尋作業,將粗體格式設定至文字範圍內每個出現的 Urgent 一詞。

Dim objFind as FindReplace 
Dim fFound as Boolean 
 
Set objFind = ActiveDocument.Pages(1) _ 
 .Shapes(1).TextFrame.TextRange.Find 
fFound = True 
 
With objFind 
 .Clear 
 .FindText = "Urgent" 
 Do While fFound = True 
 fFound = .Execute 
 If Not .FoundTextRange Is Nothing Then 
 .FoundTextRange.Font.Bold = True 
 End If 
 Loop 
End With

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。