Write text at the beginning of a .doc file

Hello everybody,

currently I try to append a string at the beginning of a .doc file.
Is there any way to do this?

1 Like

Yah we can use
Append text activity within word application scope, for that go to manage packages in design tab and search in all packages as uipath.word.activities and install it
–then under that activity in activities panel choose APPEND TEXT
https://docs.uipath.com/activities/docs/word-append-text

Cheers @em17

Thank you for your solution. Indeed I am looking for a solution to write the new text at the beginning of an existing file.

For example:

Existing doc file:

Hello this is a test for Robotics.

StringToAdd:

This is the new string.

Result:

This is the new string.
Hello this is a test for Robotics.

1 Like

In that case we can first use READ TEXT activity and get the text in word as a string variable named instring
—now use a assign activity and mention like this
“This is the new string.” + Environment.Newline + I nString.ToString

Now we can use append with new word document file path
Cheers @em17

1 Like

Thanks!

1 Like

No worries
Cheers @em17

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.