【问题标题】:VBA - Sharepoint Check-out and Check-in a non-excel fileVBA - Sharepoint 签出和签入非 excel 文件
【发布时间】:2021-02-13 00:12:22
【问题描述】:

问题

Excel VBA 为 Excel 工作簿提供了 CheckOut 和 CheckIn 的方法,如下所示:

if workbooks.CanCheckOut(sFile) then
   workbook.CheckOut(sFile)
   set wb = workbooks.open(sFile)

   'make changes

   wb.CheckIn true, "Some comment", true
end if

但是,如果我尝试签出文本文件(或任何其他文件),我该怎么做?

【问题讨论】:

    标签: vba sharepoint


    【解决方案1】:

    我发了sharepoint library

    签出/签入文件:

    Dim sp as stdSharepointSite
    set sp = stdSharepointSite.Create("teams","http://teams/wholesale/Leicester", "myUser", "myPass")
    
    if sp.CheckOutFile("http://teams/wholesale/Leicester/myFile.txt", false) then
       'Can and have checked out
       'Do stuff
       
       if thereAreChanges then
           'save file to sharepoint
           '...
    
           'check in changes
           sp.CheckInFile("http://teams/wholesale/Leicester/myFile.txt", "Updated my file")
       else
           'Discard checkout
           sp.CheckOutDiscard("http://teams/wholesale/Leicester/myFile.txt")
       end if
    else
        'Cannot checkout...
    end if
    

    【讨论】:

      猜你喜欢
      • 2014-05-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-18
      • 2017-08-05
      • 1970-01-01
      • 2019-01-07
      相关资源
      最近更新 更多