• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Adding, Replacing & Removing Bookmarks in Word in Java

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

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.
      Bookmark Topic Watch Topic
    • New Topic