Is it possible to delete an entire line from a Word document (.docx) if a wildcard is found within that line? This is not always within a table, but rather within a paragraph.
Currently I am finding user-defined wildcards within a template Word doc, and replacing it with a user-entered value. But if the value is blank, I'd like to delete the line the wildcard was found in within the paragraph. If not possible, is it possible to perform this within a table?
Thank you.
Wow, thank you for the all the samples for this.
The method that I'm looking for in particular would be the delete line one. However in the sample, we know before-hand the entire line that we want to delete. My particular use-case is, if I have a wildcard within a line, how can I select the entire line it is located in, and then delete that.
As an example, this could be a paragraph that I am searching through:
If I wanted to find a wildcard in the above, say "290" and delete the entire line it is in (" Washington with 290 employees, several regional sales teams are located throughout "), is that possible to do currently? Or can I only programmatically find the entire paragraph?