Example: Content property

This example adds an user field and sets text content for it.

  TextFields fields = document.getFields();
  TextField field = fields.add(document.getParagraphs().item(1).getRange().getStart(), "User", "User_Defined_Field");
  field.setContent("new content");

Related information

Content property