2016-10-04 85 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

相關問題