VBScript to Replace Text in Word

Hi,

Currently trying to replace multiple text placeholders in a word document by invoking this script in UiPath

However, when I try to replace a text placeholder with a text with string, it only takes the first word.
Example:
Text in Word: “Cat”
Text to Replace with: “Dog Puppy”
After VBScript: “Dog”

@CC_Pet

Use Replace Text activity inside Word Application Scope activity instead of VB script to replace the particular text.

1 Like

Yes, originally we used the built in UiPath activities but because we are processing a large number of documents, the total time taken was very long. Was hoping VBScript could reduce the time taken or if there was any other solution for this.

Did you try to do MatchWholeWord as False? If it is not the solution, then you can maybe print objSelection.Find.Replacement.Text out after assigning with the help of MsgBox?