Tuesday, November 17, 2009

Sharepoint : How to set content approval status programatically

There are business scenarios when we need to programmatically set content pusblishing status of an Item. Examples would be the custom workflow for publishing or content approval. Following simple line of code can be used to set approval status.


item.ModerationInformation.Status = SPModerationStatusType.Approved;
item.Update();

2 comments:

  1. All i can say is simple
    Thanks

    ReplyDelete
  2. thanx a lot Danish
    Keep it up

    Cheers
    Ravi

    ReplyDelete