Thursday, March 13, 2008

MOSS VisualStudio Workflow change document metadata

To change a metadata of the document of the workflow do the following:

SPListItem document = workflowProperties.Item;
document.File.CheckOut();
// for example the title metadata
document["Title"] = "title";
document.Update();
document.File.CheckIn("check in description", SPCheckinType.MajorCheckIn);

No comments: