是否有我可以编写的宏、VBA 代码或 VBScript 来编辑 Word 文档中所有超链接的 URL? Word 97-2003 或 docx 格式。
最佳答案
Dim doc As Document
Dim link, i
'Loop through all open documents.
For Each doc In Application.Documents
'Loop through all hyperlinks.
For i = 1 To doc.Hyperlinks.Count
'If the hyperlink matches.
If LCase(doc.Hyperlinks(i).Address) = "http://www.yahoo.com/" Then
'Change the links address.
doc.Hyperlinks(i).Address = "http://www.google.com/"
'Change the links display text if desired.
doc.Hyperlinks(i).TextToDisplay = "Changed to Google"
End If
Next
Next
这是所有 Hyperlink Methods and Properties 的链接
关于vbscript - 如何以编程方式编辑 Word 文档中的所有超链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3355266/