Skip to main content

Groovy Script - Read File Attribute Values from the Edit Attributes Screen and Update Custom XML parts of the .docx file

Description: Sample Groovy Script to read file Attribute values from the Edit Attributes screen and write that Attribute data into custom XML parts of the .docx file.

Context: Document (.docx)

Document Type: File

Remark: Accessible in 'Post' task mode only.

Script:

def execute(){
HashMap<String,String> attributeMapping = new HashMap<>();
attributeMapping.put(IDocumentAttribute.REV,"Revision");
attributeMapping.put("Signatory Department","AuthorDepartment");
attributeMapping.put("My Classification","Classification");

documentService.writeAdoddleAttributesToFilePropertyAttributes(attributeMapping);
}
Did this answer your question?