Hi All
I will have line called “This is Mine” need to remove entire line from the word template pls suggest any one how to fix
Thanks
Venkatareddy.D
Hi All
I will have line called “This is Mine” need to remove entire line from the word template pls suggest any one how to fix
Thanks
Venkatareddy.D
Can you please share screenshot of that word document and need to check once how its looks in word document.
You can simply use the text.replace activity and replace it with nothing. @venkatreddy
Check this: How to manipulate a part of string: Split, Trim, Substring, Replace, Remove, Left, Right
Hi @venkatreddy ,
We could try the Following Steps assuming that you would know atleast a distinguished part of the Lines that you need to remove.
strLineIndicators = {"This is Mine"}
Next, Using Read Text
from UiPath.Word.Activities
Package read the Entire Document Text, output to a variable say , wordDocText
We find the Complete lines of the Line Indicators by using the Below Expression :
linesToRemove = Split(wordDocText,Environment.NewLine).Where(Function(x)strLineIndicators.Any(Function(y)x.Contains(y))).ToArray
where linesToRemove
is also an Array of String
and it holds the matching lines that need to be removed.
For Each
Activity Iterate through the linesToRemove
and inside For Each use Replace Text in Document
ActivitySearch for
field pass the item from For EachReplace with
, we can pass an Empty String.This Should do the required operation, provided we ae able to find the Lines based on the Indicators properly.
Let us know if you are facing any difficulties.