Manage Microsoft® Excel Document Metadata via C++
View, insert, update, remove or extract custom and built-in Excel document properties within C++ applications.
Metadata in Excel - How to view, insert and remove excel file metadata. C++ Excel Library faclitates is in easy way by supporting the built-in / system-defined properties such as author name, title, document statistics etc needed sometime like to check when lastly file is modified or saved along with custom / user-defined properties in the form of name/value pairs. To automate the process, library supports creating and maintaining large metadata Excel files. Workbook class Opens a workbook by path, by stream and by special FileFormatType. So load the file with appropraite method for further processing. Few of the possibilities listed below and developers can easily enhance their code according to application requirement.
Read and Update Builtin Properties
For automating the built-in properties, API provides GetBuiltInDocumentProperties() method that returns a DocumentProperties collection representing all the built-in document properties of the spreadsheet. After accessing all the builtin properties, access the relevant properties using relevant method such as GetTitle(), GetSubject() etc. To update the properties, API provides method such as SetTitle, SetSubject, SetAuthor, SetComments etc. View the builtin document property collection for required function.
C++ Code to Read System Defined Properties
C++ Code to Update Builtin Properties
View and Add Custom Defined Properties
For handling custom properties, API provides Workbook::GetCustomDocumentProperties that returns all the custom document properties collection of the spreadsheet. Firstly accessing the custom properties via this method, developers can use relevant methods to add properties like AddIDocumentProperty, AddLinkToContentProperty and similarly use UpdateLinkedPropertyValue, UpdateLinkedRange to update custom document property value which links to content and to linked range respectively. Developers can use relevant method from collection of custom document properties .