Notitie
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen u aan te melden of de directory te wijzigen.
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen de mappen te wijzigen.
Sets or retrieves a String representing the replacement text in the specified range or selection. Read/write.
Syntax
expression.ReplaceWithText
expression A variable that represents a FindReplace object.
Return value
String
Remarks
The default setting of the ReplaceWithText property is an empty String.
If the ReplaceScope property is set to either pbReplaceScopeOne or pbReplaceScopeAll and the ReplaceWithText property is not set, the text found will be replaced with the default empty string, thus removing the text.
Example
The following example replaces all occurrences of the word "hello" with "goodbye" in the active document.
With ActiveDocument.Find
.Clear
.FindText = "hello"
.ReplaceWithText = "goodbye"
.MatchWholeWord = True
.ReplaceScope = pbReplaceScopeAll
.Execute
End With
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.