Python でのドキュメント プロパティの管理

Aspose.Cells - ドキュメント プロパティの管理

開発者は、索引また名前から特定のプロパティを取得するためのプロパティのcustom_properties以下の例で示されているコレクション。

Python コード

 workbook = self.Workbook(self.dataDir + "Book1.xls")

# Retrieve a list of all custom document properties of the Excel file

customProperties = workbook.getWorksheets().getCustomDocumentProperties()

# Accessing a custom document property by using the property index

# customProperty1 = customProperties.get(3)

# Accessing a custom document property by using the property name

customProperty2 = customProperties.get("Owner")


# Adding a custom document property to the Excel file

publisher = customProperties.add("Publisher", "Aspose")

# Save the file

workbook.save(self.dataDir + "Test_Workbook.xls")

# Removing a custom document property

customProperties.remove("Publisher")

# Save the file

workbook.save(self.dataDir + "Test_Workbook_RemovedProperty.xls")

\# Print message

print "Excel file's custom properties accessed successfully."

実行中のコードをダウンロード

ダウンロード**Hello World (Aspose.Cells)**以下のソーシャルコーディングサイトのいずれかから: