I have a word document and trying to replace values/words from 2 excel spreadsheets. One excel spreadsheet has the original values in the word doc. The second excel contains the values I am trying to change the word doc values/words to.
I use the Replace Text activity. When both of the boxes are variables, the bot only changes the first occurrence of the value/word. I cannot use a version more recent than 1.3.0 Word Activities Package because of restrictions. I Write Line shows the correct output.
Sequence is:
Excel Application Scope- Read Cell output prevObligation
Excel Application Scope- Read Cell output currentObligation
Word Application Scope- Replace Text - prevObligation = current Obligation
Only the first occurrence changed.
I am running into the same issue when I click “Replace All.” It found the first occurrence and changed it but there are 4 occurrences it didn’t change.
I spoke too soon. The Replace All activity in Word worked once after I changed the variable type to String from Generic. Now it is only correcting the first occurrence again.
I am reading a budget so data I need is dispersed throughout the spreadsheet and in 2 separate sheets, not in columns/rows ex. E52 output is prevObligation variable, C19 output is currentObligation variable.
@Jessica_Moseley - Ctrl H → Will bring the Replace Pop up on to the screen. For Replace All, I used “Alt + A”…Please see the below screenshot, in the “Replace All” word Ais underlined, so I sent Alt +A key…That’s it…
After watching it run closely, I discovered the first variable had a white space after it. Once I put variable.replace(" ", “”) in the Type Into activity- Find What field, Word replaced all of the occurrences.