---
title: "Customize Field Properties in Java"
---


{{% alert color="grey" %}}

## Purpose Summary

This page explains how to customize field properties such as result formatting, switches, and update behavior.

{{% /alert %}}

Aspose.Words provides the ability to programmatically interact with various field properties. In this article, we will look at a couple of examples so that you understand the basic principle of working with field properties. You can see the full list of properties for each field type in the corresponding class in the [Fields namespace](https://reference.aspose.com/words/net/aspose.words.fields/).

## Field Property Update

Sometimes users need to change the value of a field property. For example, update the [AuthorName](https://reference.aspose.com/words/java/com.aspose.words/fieldauthor/#getAuthorName) property of the `AUTHOR` field or change the [FieldName](https://reference.aspose.com/words/java/com.aspose.words/fieldmergefield/#getFieldName) property of the `MERGEFIELD` field.

The following code example shows how to rename merge fields in a Word document:

{{< gist "aspose-words-gists" "022e103c106b865dff94e9c742357573" "rename-merge-fields.java" >}}

## Field Display Result

Aspose.Words provides a property to obtain the field's result for fields that do not have a field separator node. We call this "fake result" or display result; MS Word displays it in the document by calculating the field's value on the fly, but there is no such value in the document model.

The following code example shows the usage of [DisplayResult](https://reference.aspose.com/words/java/com.aspose.words/field/#getDisplayResult) property:

{{< gist "aspose-words-gists" "022e103c106b865dff94e9c742357573" "field-display-results.java" >}} 

## FAQ

1. **Q:** How can I rename a `MERGEFIELD` in a Word document using Aspose.Words for Java?  
   **A:** Load the document, iterate through its fields, locate `FieldMergeField` instances, and call `setFieldName("NewName")` on each field you wish to rename. After updating, save the document.

2. **Q:** How do I obtain the result of a field that has no field separator (the “fake” result) in Java?  
   **A:** Use the `Field.getDisplayResult()` property. This returns the value that Word would display for the field even when the field does not contain a separate result node.

3. **Q:** How can I change the author name of an `AUTHOR` field programmatically?  
   **A:** Cast the field to `FieldAuthor` and call `setAuthorName("New Author")`. The change is reflected when the document is saved or when the field is updated.

4. **Q:** Is it possible to modify other field‑specific properties such as date or numeric formats?  
   **A:** Yes. Each field type exposes its own set of properties (e.g., `FieldDate.setDateTimeFormat`, `FieldFormula.setFormula`). Adjust these properties as needed and then update the field to apply the new formatting.