views:

14

answers:

1

Hi all

Is it possible to manually add and modify the versions of a document using the object model?

As example I want to be able to get the SPListItemVersion object of a document and modify its properties. It seems to me that all properties are read-only, so it is not possible to modify anything.

Is there any workaround for this availalbe? I need this functionality for importing multiple document versions.

+1  A: 

When I implemented an option to move documents between sites, a similar problem came up. What you can is push versions into the item.Versions array, and I found an online sample at http://www.k2distillery.com/2009/10/copy-splistitemversion.html

Look for the //loop over the soureitem, restore it comment.

F.Aquino