• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Adding, Replacing & Removing Bookmarks in Word in Java

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Introduction

A bookmark in Word works like a bookmark we might place in a book. We can use a bookmark to quickly jump to a specific location within a Word document. In this article, we’re going to introduce how to add bookmarks, replace the content of bookmarks and remove bookmarks in a Word document programmatically in Java using Free Spire.Doc for Java API.

Before Start

Download Free Spire.Doc for Java from this link and import the Spire.Doc.jar file into your Java project.

Using the code

  • Adding Bookmarks


  • The following example demonstrates how to add simple bookmark and nested bookmark to a Word document.




  • Replacing the content of bookmarks


  • The following examples shows how to replace the content of an existing bookmark.




  • Remove bookmarks


  • The following example shows how to remove a bookmark from a Word document but keep the content in the bookmark.




    Hope you find this article helpful and informative.
     
    rubbery bacon. crispy tiny ad:
    Enterprise-grade Excel API for Java
    https://products.aspose.com/cells/java
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!