Вопрос

I have a ItemAdded remote event receiver for a document library in the host web. Event receiver works fine. However I would like to access the properties of the file object. (Would like to see the properties for a office document)

The file object does not have properties exposed but the MSDN post below says the file members have public properties exposed.

https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.file_members.aspx

Has anyone ever worked out a way to read the Microsoft.sharepoint.client.file properties?

Это было полезно?

Решение

I am able to solve the above problem to access custom file properties using OpenXML.

In this instance, I had to either create a WordProcessingDocument or SpreadsheetDocument from the File stream depending on the file type.

once I have the document I able to read the CustomFilePropertiesPart and access the properties as required.

Hope this helps someone.

Cheers,

ShanVeer.

Другие советы

string filename = Convert.ToString(properties.ItemEventProperties.AfterProperties["Title"]);
Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top