Sub test()
Dim x%
For x = 1 To ActiveDocument.Hyperlinks.Count
Dim a As String
a = ActiveDocument.Hyperlinks.Item(x).Address
ActiveDocument.Hyperlinks.Item(x).Address = "http://poj.org/problem?id=" + Right(a, 4)
Next
End Sub
这是解决问题的代码
主要是我下载了一篇Word文档,里头关于ACM训练题分类,但是所有的链接都是指向老的服务器,会出现错误。在替换中没有替换超链接的功能(可能我没有找到)。
网上搜了一下 可以用VBA解决。 就到处找函数。终于成功解决。
哈哈哈
一次替换所有超链接