إضافة خصائص مخصصة مرئية داخل لوحة معلومات المستند
Contents
[
Hide
]
يمكن استخدام Aspose.Cells لإضافة خصائص مخصصة داخل عنصر المصنف والتي تكون مرئية داخل لوحة معلومات المستند. يمكنك فتح لوحة معلومات المستند في Microsoft Excel باستخدام ملف> معلومات> خصائص> إظهار أوامر قائمة لوحة المستند.
الرجاء استخدامWorkbook.getContentTypeProperties (). add () لإضافة خاصية مخصصة ستكون مرئية في لوحة معلومات المستند
مثال
يضيف نموذج التعليمات البرمجية التالي خاصيتين مخصصتين. الخاصية الأولى بدون أي نوع والخاصية الثانية لها نوع التاريخ والوقت. بمجرد فتح ملف Excel الناتج الذي تم إنشاؤه بواسطة هذا الرمز ، سترى هاتين الخاصيتين داخل لوحة معلومات المستند.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |