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.
Unfortunately, activation email could not send to your email. Please try again.

How to delete a bookmark

Thread ID:

Created:

Updated:

Platform:

Replies:

116338 May 16,2014 06:22 AM May 21,2014 11:29 AM ASP.NET Web Forms (Classic) 5
loading
Tags: DocIO
Chris Crowhurst
Asked On May 16, 2014 06:22 AM

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

Sathish K [Syncfusion]
Replied On May 19, 2014 06:35 AM

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


Chris Crowhurst
Replied On May 19, 2014 09:29 AM

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

 


Sathish K [Syncfusion]
Replied On May 20, 2014 07:26 AM

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


Chris Crowhurst
Replied On May 20, 2014 12:10 PM

Thanks!!!

Sathish K [Syncfusion]
Replied On May 21, 2014 11:29 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;