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();

Comments

  1. All i can say is simple
    Thanks

    ReplyDelete
  2. thanx a lot Danish
    Keep it up

    Cheers
    Ravi

    ReplyDelete

Post a Comment

Popular posts from this blog

Sharepoint 2007 Showing outlook Inbox using outlook active X control

IIS Configuration Error Error: Cannot write configuration file due to insufficient permissions

Grails - Introduction