Send a backspace key in word

I am trying to send a backspace command through the replace text activity. What should I enter in the “replace with” field to accomplish this?

1 Like

hi why would you do this?,
i dont think this is a good practice ,

i think to send backspace or delete a string
you can it like this

  1. get the full string text
    2.modify the string using string manipulation
    3.paste or write the full text again in the field you want


I have a placeholder in a template file. It contains 10 placeholders to “titles”. The user can have anywhere from 1-10 “titles”. For example, if the user enters 5, I want to delete the following 5. Currently, I am just sending “” to leave a blank space but I have to manually format the doc after. I would like for it to remove those 5 lines of blank space. The easiest way to do this with current logic is to send a single backspace command if the user leaves a process blank in the form.

Not sure what you mean by it not being good practice.

Hey @Vinny_LaRocca

If you want to send a backspace hotkey then its possible with UiAutomation.


Is ui automation the only way to do this?

The other way around I see here is to use Microsoft Interop Library or VB Script!

Hello @Vinny_LaRocca

can you give more clarity on your requirement. Please share a screenshot of the word and explain where you want to add the backspace.


Screenshot 2022-08-04 162023
I want to delete {ASSUMPTION#}, backspace to get rid of the bullet point anmd backspace again to delete the line.

Okay @Vinny_LaRocca

What if I would say don’t have a placeholder itself and just add a new line with bullet point whenever there is an assumption.

Will that fulfill your need ?

I would still need to backspace to get rid of some of the empty space

Remove not just the placeholder but the placeholder + VbCrLf

Not sure if this will help you but see the screenshot I have included, the Type Into command includes the ability to send several different Key strokes through a dropdown selection (circled in red), the result of the selection is included in the input line (outlined in red). Also you can clear a selected field before adding the Type Into text (outlined in green) by checking the box (circled in green).

Thanks Ron. With this activity can I (and if so how) specify the document and location within it to send the backspace to?

You can’t. You’re going about this the wrong way. You should just have a placeholder for {ASSUMPTIONS} and replace it with the entire string (which you prepare ahead of time in your code) of all your assumptions.

Here is a UiPath program snippet that may be more helpful.
Main.xaml (9.0 KB)