Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.
Fri Feb 19, 2016 4:59 pm
Is it possible to "select" the parent container of a bookmark and operate on it?
As an example, I would like to delete a table row containing a specific bookmark.
-
nseyler
-
- Posts: 12
- Joined: Wed Nov 04, 2015 6:43 pm
Mon Feb 22, 2016 2:58 am
Hi,
Thanks for your posting.
Please refer to the following code.
- Code: Select all
Bookmark bookmark = doc.Bookmarks.FindByName("Test");
Paragraph p = bookmark.BookmarkStart.OwnerParagraph;
TableCell cell = p.Owner as TableCell;
TableRow row = cell.OwnerRow as TableRow;
Table table = row.Owner as Table;
table.Rows.Remove(row);
Best Regards,
Amy
E-iceblue support team
-
amy.zhao
-
- Posts: 2766
- Joined: Wed Jun 27, 2012 8:50 am
Tue Feb 23, 2016 8:18 am
Hi,
Has your issue been resolved?
Thanks for your feedback.
Best Regards,
Amy
E-iceblue support team
-
amy.zhao
-
- Posts: 2766
- Joined: Wed Jun 27, 2012 8:50 am
Tue Mar 22, 2016 3:16 pm
yes this worked, thank you!!
-
nseyler
-
- Posts: 12
- Joined: Wed Nov 04, 2015 6:43 pm
Wed Mar 23, 2016 1:24 am
Hi,
Thanks for your feedback.
I am glad that it helps. Welcome to write to us again if you have further problems.
Best Regards,
Amy
E-iceblue support team
-
amy.zhao
-
- Posts: 2766
- Joined: Wed Jun 27, 2012 8:50 am