Aspose.Words.Examples.CSharp.Programming_Documents.Bookmarks.UntangleRowBookmarks.DeleteRowByBookmark C# (CSharp) Метод

DeleteRowByBookmark() приватный статический Метод

private static DeleteRowByBookmark ( Document doc, string bookmarkName ) : void
doc Document
bookmarkName string
Результат void
        private static void DeleteRowByBookmark(Document doc, string bookmarkName)
        {
            // Find the bookmark in the document. Exit if cannot find it.
            Bookmark bookmark = doc.Range.Bookmarks[bookmarkName];
            if (bookmark == null)
                return;

            // Get the parent row of the bookmark. Exit if the bookmark is not in a row.
            Row row = (Row)bookmark.BookmarkStart.GetAncestor(typeof(Row));
            if (row == null)
                return;

            // Remove the row.
            row.Remove();
        }
    }