根据自己的需要,批量修改PPT中的超级链接。
Sub fhfghfg()
slidcount = ActiveWindow.Presentation.Slides.Count
For sld = 1 To slidcount
On Error GoTo nonono1
linkcount = ActiveWindow.Presentation.Slides.Item(sld).Hyperlinks.Count
For link = 1 To linkcount
On Error GoTo nonono
'MsgBox ActiveWindow.Presentation.Slides.Item(sld).Hyperlinks.Item(link).Address
newlink ="http://www.crownboy.com/" & Mid(ActiveWindow.Presentation.Slides.Item(sld).Hyperlinks.Item(link).Address, 1, Len(ActiveWindow.Presentation.Slides.Item(sld).Hyperlinks.Item(link).Address) - 4) & ".htm"
'MsgBox newlink
ActiveWindow.Presentation.Slides.Item(sld).Hyperlinks.Item(link).Address=newlink
nonono:
Next
nonono1:
Next
End Sub
上述VBA程序的目的是自动统计PPT中的幻灯片页面总数,自动统计页面中超级链接的总数,用双层循环来循环页面,循环每一个链接,然后替换成自己需要的链接。
