2011-10-06 63 views
1

我試圖自動化SharePoint文件上傳,簽入和批准。我使用FP RPC上傳並簽入文件,但我不知道我是否可以自動批准上傳的文件。我唯一想到的解決方案就是創建IE對象,並使用IE.visible = false自動執行批准過程。使用VBA Excel批准/拒絕文件到SharePoint Share

其他問題是,當我嘗試上傳powerpoint文件到共享點meta_info沒有更新,這就是爲什麼我的文件仍然結帳。這種情況下的任何想法?到目前爲止,我所做的唯一工作就是自動添加自定義文件屬性,以便當我上傳ppt文件時,它將自動具有所需屬性的值,並將檢入方法工作。

謝謝你們!

+0

更多信息。什麼版本的Excel。什麼版本的SharePoint。 –

+0

Excel 2007和SharePoint 2007。 – Melvin

回答

2

它可能更容易use the SharePoint webservices to edit the items moderation status

C#例子。

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.

相關問題