You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何从SharePoint文件夹批量导出文件路径以批量添加Excel超链接?

Got it, let's tackle this problem—no more manual copy-pasting 200+ paths! Here are three reliable methods to bulk export SharePoint file/folder paths, which you can then use to quickly add hyperlinks in Excel.

Method 1: PowerShell (Best for Bulk & Customization)

This method gives you full control over what data you export, and works great for large folders.

  • First, install the SharePoint Online Management Shell (you can grab it from the Microsoft Download Center if you don’t have it already).
  • Open PowerShell as an administrator, then connect to your SharePoint site:
    Connect-SPOService -Url https://yourtenant.sharepoint.com/sites/yoursite
    
  • Run this script to export file details (including full URLs) to a CSV file (easy to import into Excel later):
    # Replace these placeholders with your actual SharePoint info
    $siteUrl = "https://yourtenant.sharepoint.com/sites/yoursite"
    $folderServerRelativePath = "/sites/yoursite/YourLibrary/TargetFolder"
    $outputCsvPath = "C:\YourLocalFolder\SharePointFilePaths.csv"
    
    # Set up SharePoint client context
    $context = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
    $credentials = Get-SPOCredentials
    $context.Credentials = $credentials
    
    # Get target folder and its files
    $folder = $context.Web.GetFolderByServerRelativeUrl($folderServerRelativePath)
    $files = $folder.Files
    $context.Load($files)
    $context.ExecuteQuery()
    
    # Collect file data
    $exportData = @()
    foreach ($file in $files) {
        $exportData += [PSCustomObject]@{
            FileName = $file.Name
            FullUrl = $siteUrl + $file.ServerRelativeUrl
            ServerRelativePath = $file.ServerRelativeUrl
        }
    }
    
    # Export to CSV
    $exportData | Export-Csv -Path $outputCsvPath -NoTypeInformation
    
  • After running the script, open the CSV in Excel—you’ll have all the full URLs ready to turn into hyperlinks.
Method 2: SharePoint's Built-In "Export to Excel" (Quick & No-Code)

If you want a zero-effort approach without scripts, use SharePoint’s native export feature:

  • Navigate to your target SharePoint folder.
  • Click the Library tab at the top of the page, then select Export to Excel.
  • Open the downloaded Excel file—look for columns like Path or Full URL (naming varies by SharePoint version) that contain the direct links to your files.
  • Pro tip: Filter the SharePoint library view to only show your target folder before exporting, so you don’t get extra files you don’t need.
Method 3: Excel Power Query (Pull Paths Directly Into Excel)

This lets you import file paths straight into Excel without downloading a CSV first:

  • Open a new Excel workbook.
  • Go to the Data tab > Get Data > From Online Services > From SharePoint Online List.
  • Enter your SharePoint site URL, sign in, then select the library that houses your target folder.
  • In the Power Query Editor, use the Folder Path column to filter for only your target folder’s path.
  • You’ll see a Full Path or URL column with all the file links—click Close & Load to bring this data into your workbook.
  • To turn these into clickable hyperlinks, use Excel’s HYPERLINK function in a new column:
    =HYPERLINK(A2, B2)
    
    (Replace A2 with the cell containing the full URL, and B2 with the filename you want to display as the link text.)

Once you have the list of URLs in Excel, you can either use the HYPERLINK function for bulk links, or select the URL column, right-click > Link to assign links manually (though the function is way faster for 200+ entries).

内容的提问来源于stack exchange,提问作者MLaser

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 07:27:09