Delete data from word

Hay, I have problem with delete data from word. I wanna delete some kind of table from word. I save that data in one variable and I don’t know haw to delete that. Replace doesn’t working in this case. Please if someone know how to do that. Maybe with some hotkey? But when I try that I don’t know haw to say ok I wanna delete exactly that table.


Do one thing. If there is any fixed word before or after of the table then follow this steps.

  1. Read entire word document and store it in a String variable say ‘wordText’.

  2. Int before = wordText.IndexOf(“beforeWord”)+“beforeWord”.Length

  3. Int after = wordText.IndexOf(“afterWord”)+“afterWord”.Length

  4. String tableData = wordText.SubString(before,after-before)

  5. String finalWord = wordText.Replace(tableData,"")

1 Like

Isn’t working, I don’t know why.Proba.xaml (39.0 KB)