Skip to content

Find and replace text in a Word document in Java without Microsoft Word or interop dependencies.

Notifications You must be signed in to change notification settings

SyncfusionExamples/Java-Word-Find-and-Replace-Examples

Repository files navigation

Java Word Find and Replace Examples

This repository contains examples that illustrates how to find and replace text in Word documents programmatically in Java using Syncfusion’s Java Word library (Essential DocIO) without Microsoft Word or Office interop dependencies.

Find and replace text in Word documents using Java

The Syncfusion Java Word library (Essential DocIO) provides comprehensive APIs to find and replace text in a Word document with any desired text, image, hyperlink, paragraph, table, and part of a document or an entire document. It provides options to find text by matching case and whole words. You can find each occurrence one by one or all the occurrences of a text in the document. It saves your efforts and time by helping you to automate find and replace a pattern of text in a Word document using Regex. It allows you to save the resultant document as Word document (DOCX, WordML), HTML, RTF.

Jar files

You can download the jars from the Syncfusion maven repository to use our artifacts in your projects. It helps you to use the Syncfusion Java packages without installing Essential Studio or platform installation to development with Syncfusion controls.

Key Features

Screenshots

Find and highlight text

Find text from a Word document and format or highlight it in Java

Find and replace text

Find a misspelt word from a Word document and replace it with desired word in Java

Replace text with table

Find text from a Word document and replace it with a table in Java

Syncfusion Java Word Library

The Syncfusion DocIO is a Java Word library allows you to add advanced Word document processing and does not require Microsoft Word application to be installed in the machine. It is a non-UI component that provides a full-fledged document instance model similar to the Microsoft Office COM libraries to iterate with the document elements explicitly and perform necessary manipulation.

Take a moment to peruse the documentation, where you can find basic Word document processing options along with the features like mail merge, merge, find and replace text in the Word document, protect the Word documents and most importantly, RTF, Text, and HTML conversions with code examples.

Compatible Microsoft Word Versions

  • Microsoft Word 97-2003
  • Microsoft Word 2007
  • Microsoft Word 2010
  • Microsoft Word 2013
  • Microsoft Word 2016
  • Microsoft Word 2019
  • Microsoft 365

Supported File Formats

Resources

Support and feedback

For any other queries, reach our Syncfusion support team or post the queries through the community forums.

Request new feature through Syncfusion feedback portal.

License

This is a commercial product and requires a paid license for possession or use. Syncfusion's licensed software, including this component, is subject to the terms and conditions of Syncfusion's EULA. You can purchase a licnense here or start a free 30-day trial here.

About

Find and replace text in a Word document in Java without Microsoft Word or interop dependencies.

Topics

Resources

Stars

Watchers

Forks

Languages