问题
I have associated my custom content type with my document library in sharepoint, and each content type is connected with a template.
Is there a way that I can access content fields values with 'office js' so that I can update my content fields values by code?
I tried 'CSOM', I can access the fields and can edit, however when I save I got error message saying the document is in use or is locked by another person.
Note: with 'context.document.properties' I can only access the buildin properties while with 'context.document.properties.customproperties' I can only access 'ContentTypeId'.
Please someone share some lights, thanks!
ctfields show up in document properties
回答1:
The question is not clearly written to understand what you are looking for. The document library properties don't show up as part of default or custom properties. These are simply key:value pairs defined in the document (built-in or custom). You'd need to look at the custom XML parts to access the SharePoint document library properties that are saved to the document. I'm not very sure about the Word APIs. For that you may need to look under the v1.0 API set to access doc library properties
来源:https://stackoverflow.com/questions/50642434/content-type-fieldscustomxmlparts-document-custom-properties