Remove Bookmark in Word with NET REST API

This article guides on how to remove bookmark in Word with NET REST API. You will learn to automatically remove bookmark in Word with C# REST API using the .NET cloud SDK. You can iterate this process to remove all the bookmarks from a Word file.

Prerequisite

Steps to Delete Bookmark in Word with C# REST API

  1. Instantiate the Configuration object by setting the ClientId and ClientSecret
  2. Create the WordsApi object using the given configuration
  3. Read the input Word file into the byte array
  4. Instantiate the DeleteBookmarkOnlineRequest request object by providing the bookmark name
  5. Invoke the DeleteBookmarkOnline method to remove the bookmarks
  6. Save the resultant Word file after deleting the specified bookmark

The above steps summarize how to delete a bookmark in Word with C# Low Code API. Instantiate the WordsApi object and read the input Word file into the byte array. Create the DeleteBookmarkOnlineRequest object and set the bookmark name that you want to delete from the Word file followed by calling the DeleteBookmarkOnline() method to delete the bookmark.

Code to Delete Bookmark in Word with C# Low Code API

This sample code exhibits how to delete a bookmark in Word with NET REST API. Note that if you do not provide a target bookmark name while initializing the DeleteBookmarkOnlineRequest object and do not provide this argument, it will delete all the bookmarks from the loaded Word file.

This article has taught us the process of removing a particular bookmark from a Word file. If you are interested in adding a bookmark, refer to the following article: Add Bookmark in Word with NET REST API.

 English