我有许多大型Microsoft Word文档,其中包含许多Microsoft Excel电子表格中的许多链接文件.打开Word文档时,即使未选中"打开时更新链接文件"选项:

Word仍会通过打开和关闭每个链接的相关Excel电子表格来检查其源头的每个链接(因此,对于x个链接,即使来自同一个电子表格,Word也会打开并关闭电子表格x次).这意味着打开文档需要很长时间.
我发现如果包含链接对象源的电子表格已经打开,文档打开得更快,因此Word不会保持打开,关闭,重新打开它们.
到目前为止,我所拥有的解决方案的开头是创建链接对象的所有文件路径的列表,通过以下VBA代码完成:
Sub TypeArray()
Dim List(), Path As String
Dim i, x As Integer
Dim s As InlineShape
Dim fso As FileSystemObject, ts As TextStream
Set fso = New FileSystemObject
Set ts = fso.OpenTextFile("C:\MyFolder\List.txt", 8, True)
With ts
.WriteLine (ActiveDocument.InlineShapes.Count)
End With
For Each s In ActiveDocument.InlineShapes
Path = s.LinkFormat.SourcePath & "\" _
& s.LinkFormat.SourceName
With ts
.WriteLine (Path)
End With
Next s
End Sub
'-------------------------------------------------------------------------------------- …Run Code Online (Sandbox Code Playgroud)