Adding Custom Properties visible inside Document Information Panel
Aspose.Cells can be used to add custom properties inside the workbook object which are visible inside the Document Information Panel. You can open the Document Information Panel in Microsoft Excel using File > Info > Properties > Show Document Panel menu commands.
Please use Workbook.getContentTypeProperties().add() method to add a custom property which will be visible in Document Information Panel
Example
The following sample code adds two custom properties. The first property is without any type and the second property has a type as DateTime. Once, you will open the output Excel file generated by this code, you will see these two properties inside the Document Information Panel.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(AddingCustomProperties.class); | |
// Create workbook object | |
Workbook workbook = new Workbook(FileFormatType.XLSX); | |
// Add simple property without any type | |
workbook.getContentTypeProperties().add("MK31", "Simple Data"); | |
// Add date time property with type | |
workbook.getContentTypeProperties().add("MK32", "04-Mar-2015", "DateTime"); | |
// Save the workbook | |
workbook.save(dataDir + "output.xlsx"); |
Related Article