寻找超链接单击事件或Word 2010中的某些内容

时间:2019-01-18 07:35:26

标签: vba pdf hyperlink ms-word

我有Ulf Gjerdingen的这个模块:

Dim targetLink As String
Dim targetName As String
Dim pageNumber As Integer
Dim pathPDF As String
targetName = Selection.Hyperlinks(1).Name
parts = Split(targetName, "page=")
pageNumber = parts(1)
pathPDF = Selection.Hyperlinks(1).Address
Call OpenPagePDF(pathPDF, pageNumber)

Public Function OpenPagePDF(sMyPDFPath As String, iMyPageNumber As Integer)
Dim RtnCode, AdobePath As String
AdobePath = "Path to Acrobat Reader"
RtnCode = Shell(AdobePath & " /a " & Chr(34) & "page=" & iMyPageNumber & "=OpenActions" & Chr(34) & " " & Chr(34) & sMyPDFPath & Chr(34), 1)
End Function

Modul的运行就像一个超级按钮,但是如果有人单击wordfile中的任何超链接,我想运行该模块。

有没有可以捕获的事件?我在参考资料中找不到任何内容。我正在使用Word 2010。

谢谢

0 个答案:

没有答案