We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to delete a bookmark

Hi,

How do you delete a bookmark in a word document ? I have a bookmark that I wish to delete once I am finished using it, but can't seem to find out how to do this? I know how to create bookmarks and move to them just fine.

Regards

Chris

5 Replies

SK Sathish K Syncfusion Team May 19, 2014 10:35 AM UTC

Hi Chris,

 

Thank you for your interest in Syncfusion products.

 

Kindly use the below code snippet to delete the bookmark contents.

 

BookmarksNavigator bn = new BookmarksNavigator(document);

//Moves to the bookmark

bn.MoveToBookmark("Bookmark1");

//Deleting bookmark contents

bn.DeleteBookmarkContent(false, true);

Please let us know if you have any other questions.

 

Regards,

Sathish



CC Chris Crowhurst May 19, 2014 01:29 PM UTC

Hi Satish,

I don't think you understood my question. :)

I don't want to delete the bookmark content, I just wish to remove the actual bookmark itself. Similar to how you do it in word. e.g. Using the "Delete" button from the Bookmarks dialog to remove it from the list.

Regards

Chris

 



SK Sathish K Syncfusion Team May 20, 2014 11:26 AM UTC

Hi Chris,

 

Thank you for your update.

 

Kindly use the below code snippet to delete a bookmark from the input Word document.

 

//Finds the bookmark by name

Bookmark bookMark = document.Bookmarks.FindByName("BookMarkName");

//Deletes the bookmark

document.Bookmarks.Remove(bookMark);

 

Please let us know if you have any other questions.

 

Regards,

Sathish



CC Chris Crowhurst May 20, 2014 04:10 PM UTC

Thanks!!!


SK Sathish K Syncfusion Team May 21, 2014 03:29 PM UTC

Hi Chris,

 

Thank you for your update.

 

Please let us know if you have any other questions. We will be happy to assist you as always.

 

Please let us know if you have any other questions.

 

Regards,

Sathish


Loader.
Live Chat Icon For mobile
Up arrow icon