I finally realised that you could do this quite simply without going anywhere near the versioning end of the SharePoint API.
// overwrite the "published" version with a "draft" versionThis did work in my instance where I knew the "current" version of the item was Published, although I'm not sure if this also works when you have draft versions in edit (i.e. version 1.5)
item.ModerationInformation.Status = SPModerationStatusType.Draft;
item.UpdateOverwriteVersion();
No comments:
Post a Comment
If you are commenting on a post older than 14 days then it will be moderated.
I try to get these approved as soon as I can, but please be patient if it doesn't appear straight away.