Does anyone know how i can delete a column of a table in word from c#? I basically search a word doc for tables and for each table ive found, i want to delete the entire column with the name “Student ID” from that table. I know you can delete by column index using code like:
wordTable.Columns[0].Delete();
But i need a way to delete the column based on the name of the column since each table in the doc may have the student id column in different indices.
Thanks
Tables don’t have names as such – what you probably mean is the column whose top cell has “Student ID” in it. You’re going to have to walk the columns and look at the top cell in each (presumably you can at least guarantee that has the lowest cell index) to find if it has the text you’re looking for.