Hi,

I am trying to add a VBA code to a word document that has hyperlinks that opens other documents to specific pages. I am able to do it when they are in the doc form however, when I convert all docs to pdf I loose the hyperlinks. I tried the following VBA code to see if it would open the pdf file to the specific destination (like a specific name/bookmark/or page). I have Adobe Acrobat 9 Pro.

Sub GoToPDFPage()
Dim targetLink As String
Dim targetName As String
Dim pageNumber As String
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)
End Sub
Public Function OpenPagePDF(sMyPDFPath As String, iMyPageNumber As Integer)
Dim RtnCode, AdobePath As String
AdobePath = "C:\Program Files (x86)\Adobe\Reader 11.0\Reader"
RtnCode = Shell(AdobePath & " /a " & Chr(34) & "page=" & iMyPageNumber & "=OpenActions" & Chr(34) & sMyPDFPath, vbNormalFocus)
End Function


I aslo get the Sub GoToPDFPage () hilighted in Yellow.
I get the Compile error variable not defined where I write about the parts=Split(targetName, "page=6")