Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • 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
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

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.
     
    If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
    the value of filler advertising in 2020
    https://coderanch.com/t/730886/filler-advertising
      Bookmark Topic Watch Topic
    • New Topic