Reputation: 86
I am using Microsoft Office Interop Word in C# to edit word files. Is there a way to check the tables are under same heading?
My End goal is to delete an empty table from Word Document. That is - if two tables are present under same heading or between two given heading and one the table is empty then I want to delete the empty table.
Using below code I am able to loop through and delete the tables but don't know how to see they are under same heading.
Microsoft.Office.Interop.Word.Document doc = app.Documents
.Open(ref path, ref miss, ref readOnly, ref miss, ref miss, ref miss,
ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss,
ref miss, ref miss, ref miss);
foreach (Microsoft.Office.Interop.Word.Table tbl in doc.Tables)
{
tbl.Delete();
}
Upvotes: 0
Views: 47