When I try to click a word in Word, it comes up with the error “Click text ‘_WwG’ : Text was not found”.
To see if there was an issue with the Word document, I tried “Get text”, however the result that comes back is “Microsoft Word Document” instead of the text in the document.
It works with “Click OCR Text”, but that takes a good couple of seconds and when there’s more than one word to click, it’ll take a fair bit of time.
Has anyone come across this issue before? Or would have an idea of how to solve it, or an alternative way to click? The “Click text” worked completely fine until I updated the UiPath software, though I’m not sure if it’s that or something else.
The reason I want this is because the Robot will find some information on an application, and enter it on a Word document next to specific words, e.g. it’ll get a Client’s name on an application, their age, address, etc and then go onto the Word document, click “Client’s name”, enter the text, click “Age”, enter the text, etc
I did work with automating MS Word operations such as selecting text and formatting them.
Based on that, I can say that Text in MS word is not clickable as individual units - i.e as words in the document. We could use APIs like “Get Text” to get the entire document text though. I haven’t checked how UiPath works with Tables in MS word where it may be possible to select individual table cells.
UiPath Activities like “Mouse Click” work with anchor images which are reference images to use with the element to be clicked. This is an option to consider but it may not be satisfying your usecase where you require to identify Text nearby.
I used keyboard shortcuts for selecting text and formatting, which is the recommended approach for MS word operations, given that UiPath selectors are not reliable when document names change and other such scenarios. Is there a possibility of using keyboard shortcuts for your case?.
I didn’t want to use click image as I use two different servers, and what’s recoginised on one isn’t recognised on the other. I’m using that at the moment but I’d like to steer away from it completely.
Can you claify what you mean by keyboard shortcuts? If you mean, for example, press down x3 to go to a certain word, a few parts of text it copies into the document might be 5 lines, and on a different file it could only be 1 line, therefore there wouldn’t be a definite amount of times to press the down key
I’ve tried looking for it on the Activities Guide to work out how to use it, I think it’s going through a few problems though as I can’t access it and it keeps taking me back to the https://activities.uipath.com/docs/ page whenever I click on a header. Hopefully I’ll be able to look sometime soon when it’s fixed.
As I can’t quickly test it and haven’t used it before to say if it’ll work, and don’t want to keep bugging you, If it doesn’t solve my problem, do you have any other ideas?
Ahh ok, I had a play around and worked it out but thanks!
I won’t be able to use it unfortunately, the Word document will be freshly generated/created (as opposed to me creating it beforehand) and won’t have any bookmarks in. I can’t get the Robot to create them as I can’t get it to click on the text to highlight it, which was my original problem. Even if I could create them, it’d need to make 10+ with each document which might take a bit of time.
Do you think there’s another solution? Or is it a lost cause?
You could try “Replace Text”, if not already tried.
You could “Read Text” and then manipulate your string variable by adding your extracted values to it. Then write it back the file. This could lose the format.
I’m not trying to replace the text, I want the variable to appear next to the text, e.g. "Age: " will become “Age: 46”. Some will need to appear in the box next to the "Age: " so I can’t lose the format otherwise it would’ve been an easy fix
I was going to suggest manipulating the string then writing it back to file but the formatting can be a struggle.
However, try using the Find feature in Word (or Ctrl+F). When you search for a word, it selects that word. I’m not sure what all you need to do but that might be an ideal solution for you.
EDIT: for example, Search for "Age: ", TypeInto "Age: "+“42” OR TypeInto “[k(right)]42” to move cursor over first, et cetera