public class FieldLastSavedBy extends Field
To learn more, visit the Working with Fields documentation article.
Remarks:
Retrieves the name of the user who last modified and saved the current document, as recorded in the LastModifiedBy property of the built-in document properties.
Examples:
Shows how to use the LASTSAVEDBY field.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// If we create a document in Microsoft Word, it will have the user's name in the "Last saved by" built-in property.
// If we make a document programmatically, this property will be null, and we will need to assign a value.
doc.getBuiltInDocumentProperties().setLastSavedBy("John Doe");
// We can use the LASTSAVEDBY field to display the value of this property in the document.
FieldLastSavedBy field = (FieldLastSavedBy) builder.insertField(FieldType.FIELD_LAST_SAVED_BY, true);
Assert.assertEquals(" LASTSAVEDBY ", field.getFieldCode());
Assert.assertEquals("John Doe", field.getResult());
doc.save(getArtifactsDir() + "Field.LASTSAVEDBY.docx");
getDisplayResult, getEnd, getFieldCode, getFieldCode, getFormat, getLocaleId, getResult, getSeparator, getStart, getType, isDirty, isDirty, isLocked, isLocked, needStoreOldResultNodes, remove, setLocaleId, setResult, unlink, update, update