When a word document has identical text boxes is there a way to replace only the first instance?

Here is the problem outlined:

I have a word document that I am using to make cards for a board game based on data stored in excel. When I use the Replace Text activity, it replaces all of the instances in the document, even when I have “Replace All” unchecked.

The issue seems to be tied to the fact that the instances I am replacing are stored in text boxes inside of the word document. When I remove the text boxes the bot runs correctly.

I am using the textboxes as a way to format different elements to keep them all the same size.

Is there a way to make sure it only replaces the first instance it finds each time?

Is there another way to accomplish this?

At the end of my rope,

1 Like


I’m trying to understand the problem. Apologies if I’m off track.
If your objective is to replace text in the first text box, would it not be convenient to identify the first text box and simply replace the content of that box with the new text?

thanks and Welcome to the forums!

Hello Andy,

First off, thanks for your help and swift response!

I want to replace the text in the first text box with a value stored in an excel document in column A “CardID” Row 1, then I want to replace the same value in text box two with the value stored in column A Row 2, and on and on until I have iterated through the entire document. Correct me if I am wrong but the solution may be to figure out how to identify the first text box then select another?

Any help you can give would be very appreciated. Point me in the right direction and I’ll figure out the details.

Thanks Again,

1 Like

Hi @Abram_Miller ,

Welcome to UiPath Community !

if you share some samples, it would be helpful to get deep …


Could you change the values in your text boxes to make them unique? It is easier to use the replace text activity properly that way.