2016-10-04 132 views

回答

0

示例代码你可以publish an Excel file to Sharepoint(又名Chèvre-poing),但它看起来相当困难,因为认证机制被篡改(如山羊)。

所以,你应该做的是映射本地共享与SharePoint\\my_chevre_poing\goaty\,然后有一点点VBA它从你最喜欢的宏地点:

Sub Copy_Folder() 
'This example copy all files and subfolders from FromPath to ToPath. 
'Note: If ToPath already exist it will overwrite existing files in this folder 
'if ToPath not exist it will be made for you. 
    Dim FSO As Object 
    Dim FromPath As String 
    Dim ToPath As String 

    FromPath = "C:\local\trucs\"    '<< your own source there 
    ToPath = "\\my_chevre_poing\goaty_trucs\" '<< your share there 

    If Right(FromPath, 1) = "\" Then 
     FromPath = Left(FromPath, Len(FromPath) - 1) 
    End If 

    If Right(ToPath, 1) = "\" Then 
     ToPath = Left(ToPath, Len(ToPath) - 1) 
    End If 

    Set FSO = CreateObject("scripting.filesystemobject") 

    If FSO.FolderExists(FromPath) = False Then 
     MsgBox FromPath & " doesn't exist" 
     Exit Sub 
    End If 

    FSO.CopyFolder Source:=FromPath, Destination:=ToPath 
    MsgBox "You can find the files and subfolders from " & FromPath & " in " & ToPath 

End Sub 

您也可以找到huge resource there

相关问题