Word - Replace text at Header level?

Hi guys!

Are there any way to Replace text within a Word document at Header level?

I can’t seem i replace text and/or get text at Header level within a .docx document?

:open_mouth:

1 Like

Hi @mikamol,

You can install UiPath.Word.Activities package and use Word Application Scope activity or you can use Open Application activity. The idea is working with the open word document.

Use Get Full Text activity to read the text into the header and save the text into a string variable e.g. headerText

Use Type Into activity to write the header text with headerText.Replace("oldText","newText"). In properties you should mark EmptyField as True.

Okey, this solution is to overwritte the whole header text with the corresponding replacement, but it is an option.

I hope it helps you

1 Like

Hi @mikamol,

Here the link has the solution to your situaction

  • Use the “Remove Header and Footer” to remove the header and footer.
  • Use the “Insert Header and Footer” activity to add the Header

Regards
Balamurugan.s