We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to read / write custom attribute in MPP file

Suppose I have created custom column saying RedmineIssueNumber in my MPP file.

How can I read this column from java code and how can I insert values in it from java code.


Thank you for contacting Aspose support team.

You may please give a try to following sample code and refer to this link for more information.

// Create new project
Project project1 = new Project("Blank2010.mpp");

//1.    Adding Plain Text Attribute

//Create an Extended Attribute Definition of Text1 type
ExtendedAttributeDefinition taskExtendedAttributeText1Definition = ExtendedAttributeDefinition.createTaskDefinition(CustomFieldType.Text, ExtendedAttributeTask.Text1, "Task City Name");

//Add it to the project's Extended Attributes collection

//Add a task to the project
Task task = project1.getRootTask().getChildren().add("Task 1");

//Create an Extended Attribute from the Attribute Definition
ExtendedAttribute taskExtendedAttributeText1 = taskExtendedAttributeText1Definition.createExtendedAttribute();

//Assign a value to the generated Extended Attribute

//Add the Extended Attribute to task

project1.save("PlainTextExtendedAttribute_out.mpp", SaveFileFormat.MPP);

Project project = new Project("PlainTextExtendedAttribute_out.mpp");

for (Task tsk : project.getRootTask().getChildren())
    for (ExtendedAttribute ea : tsk.getExtendedAttributes())

Thank you so much for your reply!