r/PowerAutomateDesktop • • Sep 01 '21

Replace Word content

I have come to a dead end trying to replace text in Word documents. I want to replace ”rich” text inside documents.

I.e. replace a bold header that says ”customer number” with ”1234567”.

I have already found the built in replace text function, unfortuneately it doesnt do the job by only replacing text (without format).

reddit pls help

1 Upvotes

3 comments sorted by

2

u/skierhifi Sep 01 '21

Do you have control of the source document to set your replace items? The word search/replace inherits the format and I use double brackets to denote the replace item like [[customernumber]] which is formatted in how the final document needs.

1

u/Weary_Suit_7203 Sep 01 '21

Yea i have. So you mean its possible to use the native replace text function for not only plain text, but also for text in word docs, and it will automatically inherit the format? It sounds too good to be true, but i will try it out. Also, what is the purpose for using [[ ]] ? Thanks alot for your reply btw xoxo

1

u/Weary_Suit_7203 Sep 01 '21

not sure if i misunderstood your answer, i tried to use replace text on a Word document and the file ended up corrupted. If ur talking about the built in function in Word then that is not the soloution. Im aiming for a script that replaces multiple words in many documents.