Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

How to add text from webpage to Word doc and then replace a portion of that text?

(0) ShareShare
ReportReport
Posted on by 8

Title says it all. I am trying to capture some text from a webpage. Then once that text is captured I would like to add that text to a Word document. I would then like to replace a certain portion of that text with alternate text.

 

I was able to do this fairly easily in PA Desktop using .txt files in notepad. However to get it to specifically work in Word has proved more difficult. Neither PA Cloud nor Desktop have a ton of useful actions to interact with Word. So far I have gotten to the following:

 

1.) Use AI builder to extract text from the webpage

2.) Use "populate a Word template" to get the text into the Word doc

3.) ***Here is where I am stuck, what is a way I can replace the text with alternate text in the Word document?????

 

Any tips?

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at
    Re: How to add text from webpage to Word doc and then replace a portion of that text?

    @r_compton 

     

    That is somewhat possible, but not quite in an flexible way.  You'd have to mark every sentence in your word document like above, and connect that with a variable (or Array varialbe), and put the variables in the word document. Then you should set the variable you want to change to your desired output. 

     

     

  • r_compton Profile Picture
    8 on at
    Re: How to add text from webpage to Word doc and then replace a portion of that text?

    Hi thank you for the response, 

     

    This part worked for me well. However, I also need to search the text in the populated MS Word document, find a specific sentence, and replace that sentence with alternate text. Is there a way to do this?

     

    Thank you.

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at
    Re: How to add text from webpage to Word doc and then replace a portion of that text?

    Greetings @r_compton 

     

    This is quite easily achieveable. 

     

    - Enable Developer tab in your MS word. 

    - Add the text you want to replace

    - Mark the text

    - Click the Aa symbol (has to be the 'low' quality one)

    - Then hit properties and add the text field name. 

    - Populate this in your POpulate word document action. 

     

    Heartholme_1-1661500740724.png

     

    Heartholme_2-1661500771008.png

     

    Then in PowerAutomate: 

     

    Heartholme_0-1661500904919.png

     

    Let me know how it goes!

     

    { If my post answered your question, please Accept it as a solution ✔ }
    { This will in turn help others find solutions to similar questions }

    Best Regards
    Heartholme

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1