Apply Emphasis Marks in Word in Java

In Word, you can emphasize some important contents by adding specific symbols such as underline, overline and highlight colors. In addition, you can also use emphasis mark to make the content more noticable. This article will share how to programmatically apply emphasis marks to text in Word using Free Spire.Doc for Java.

Import Dependency


Sample Code

import com.spire.doc.*;
import com.spire.doc.documents.*;
import com.spire.doc.fields.shape.*;

public class applyEmphasisMark {
public static void main(String[] args) {
//Create word document
Document document = new Document();

//Load the document from disk

//Find text to emphasize
TextSelection[] textSelections = document.findAllString("Ancient Olympics", false, true);

//Set emphasis mark to the found text
for (TextSelection selection : textSelections) {

//Save the file
document.saveToFile("EmphasisMark.docx", FileFormat.Docx);



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store