News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Specifying SharePoint document properties via code?

Started by Nikolay, September 02, 2013, 04:37:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nikolay

You can save Visio diagrams in a SharePoint library:


The SharePoint library may have additional fields defined (in the case above, it's "Property1" and "Property2")

You can set these for a Visio document (stored in that library) on the backstage:


This brings up a dialog where you can enter values for these properties:


The question is, how do I specify these properties programmatically (by code)?
For the built-in properties like "Title" for example, I can set a Document.Title, and the "Title" field in the SharePoint library will be set accordingly.

So how do I set custom fields?

I have tried to set these fields directly as well (by SharePoint Client Object Model and even by hand) but I cannot set them while the document is opened in Visio :(
The SharePoint built-in lock prevents editing document attributes while file is being held open in office application (Visio) - "office document lock".
Generally, I would like to just fill these fields in the document programmatically, and then save the document to SharePoint.

Thank you in advance!

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 145 (show)
Files included: 32 - 1207KB. (show)
Memory used: 1007KB.
Tokens: post-login.
Cache hits: 13: 0.00248s for 26,723 bytes (show)
Cache misses: 3: (show)
Queries used: 17.

[Show Queries]