0

I am opening the excel through Excel interop and writing values into the cell of excel using excel interop .Now i need to also fill the document properties (ie) status,author and tag etc of the excel. enter image description here

How to acess the properties of excel document which are diaplayed under the Properties tab in this picture and add values into it.

Microsoft.Office.Interop.Excel;

the dll which i used.

Dah Sra
  • 4,107
  • 3
  • 30
  • 69
  • possible duplicate of [Set custom document properties with Word interop](http://stackoverflow.com/questions/12690409/set-custom-document-properties-with-word-interop) –  Jan 27 '15 at 12:53
  • @Jeeped its has said anout custome defined properties and i need to know about the predefined doaument properties.If you know please share the details.! – Dah Sra Jan 27 '15 at 13:04
  • My apologies, I've retracted my close vote. [MSDN](https://msdn.microsoft.com/en-us/library/office/microsoft.office.interop.excel.workbook_properties.aspx) states that the [BuiltinDocumentProperties](https://msdn.microsoft.com/en-us/library/office/aa224142.aspx) are read-only so you should be able to retrieve a single property by index number or all of them as a collection but I don't believe you can set a value to them. [_Workbook.BuiltinDocumentProperties property](https://msdn.microsoft.com/en-us/library/office/microsoft.office.interop.excel._workbook.builtindocumentproperties.aspx) –  Jan 27 '15 at 13:19

1 Answers1

0

It looks like you are interested in the BuiltinDocumentProperties property of the Workbook class. The property returns a DocumentProperties collection that represents all the built-in document properties for the specified workbook. Each DocumentProperty object represents a built-in or custom property of a container document. Use BuiltinDocumentProperties(index), where index is the index number of the built-in document property, to return a single DocumentProperty object that represents a specific built-in document property.

Also you may find the CustomDocumentProperties property of the Workbooks class helpful. It returns a DocumentProperties collection that represents all the custom document properties for the specified workbook.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45