1

Within a Document Library with versioning turned on, I noticed that if I create a folder and "View Properties" that there is a "Version: 1.0" that is listed as a property along with "Created By", etc. at the bottom of the page. How do I retrieve this Version value using the SPFolder object?

2 Answers 2

1

SPFolder has the property Item which gives you the folder's associated list item. This object should have the version and other field values.

2
  • Yes, but the SPListItem only has a Versions (with an 's') property, not an Version (without an 's') property. How do I determine which of the Versions corresponds to the SPFolder that I have?
    – Ants
    Apr 17, 2013 at 23:26
  • Now this makes me wonder if folders actually have a version that can change, or if it's just there because a folder is a list item. It looks like they probably don't - changing the name doesn't change the version number, and the version history button is greyed out in the ribbon.
    – lgaud
    Apr 18, 2013 at 20:02
0

If you were not aware, the Folder object is still considered to be an item in the list. It is just an item of the folder type. So in a lot of cases it is treated like a regular list item. So it just depends on what method you are using to get at this. Client side code or server side code.

1
  • Nuts, I forgot to mention in my question that this was SP2007 object model -- so it is server side code.
    – Ants
    Apr 17, 2013 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.