I'm trying to automate sharepoint file upload, checkin and approve. I'm using FP RPC to upload and checkin the file but I have no idea if I can automate approving the uploaded file. the only solution I have in mind is to create IE object and just automate the approve process with IE.visible = false.
other question is that when I try to upload powerpoint file to sharepoint meta_info is not updated that's why my files remains checkout. any idea with this scenario? so far the only work around that I had is to automate adding custom file properties开发者_Python百科 so that when I upload the ppt file it will automatically have values on required properties and checkin method will work.
thanks guys!
It may be easier to use the SharePoint webservices to edit the items moderation status.
C# from the example.
public static XmlNode UpdateListItemApprove()
{
listservice.Lists listProxy = new listservice.Lists();
string xml = "<Batch OnError='Continue'><Method ID='1' Cmd='Moderate'><Field Name='ID'/><Field Name='FileRef'>http://basesmcdev2/sites/tester1/approvals/KL022030.lic</Field><Field Name=\"_ModerationStatus\" >0</Field></Method></Batch>";
XmlDocument doc = new XmlDocument();
doc.LoadXml(xml);
XmlNode batchNode = doc.SelectSingleNode("//Batch");
listProxy.Url = "http://basesmcdev2/sites/tester1/_vti_bin/lists.asmx";
listProxy.UseDefaultCredentials = true;
XmlNode resultNode = listProxy.UpdateListItems("approvals", batchNode);
return resultNode;
}
Here is an example of an update using the SOAP toolkit.
精彩评论