I'm using POI 3.10-beta1 and it works for me, i.e. you can set it directly in the PackageProperties
:
import java.util.Date;
import org.apache.poi.openxml4j.opc.*;
import org.apache.poi.openxml4j.util.Nullable;
public class LastModifiedBy {
public static void main(String[] args) throws Exception {
OPCPackage opc = OPCPackage.open("lastmodifed.docx");
PackageProperties pp = opc.getPackageProperties();
Nullable<String> foo = pp.getLastModifiedByProperty();
System.out.println(foo.hasValue()?foo.getValue():"empty");
pp.setLastModifiedByProperty("user"+System.currentTimeMillis());
pp.setModifiedProperty(new Nullable<Date>(new Date()));
opc.close();
}
}