Creating hyperlink script to an image and specific pdf page

656
1
07-19-2021 11:41 AM
Labels (2)
MirandaBandeli
New Contributor II

I've been looking into this issue and having trouble understanding how to manage my coding. 

I'm working in a geodatabase with relative paths and was able to rework a VBScript code to work with my first shapefile. So I have two columns in my attributes table and when I select to activate the hyperlinks and hit a point - one image file (Data_Hyper) and one pdf file (Data_TOC) open at the same time: 

Function OpenLink ( [Data_Hyper]  , [Data_TOC]   )
  Dim path
  Dim objShell
  path = [Data_Hyper]
  Set objShell = CreateObject("Shell.Application")
  objShell.ShellExecute path, "", "", "open", 1
  path = [Data_TOC]
 Set objShell = CreateObject("Shell.Application")
  objShell.ShellExecute path, "", "", "open", 1
End Function
This code is not working for my new set of data, as this time I need the links to open an image and a specific page within a large pdf (last time we split it up into one pdf per sample but this time we want to keep it as one large pdf and link to the specific page for that sample). I am able to get the pdf hyperlink to work if it's the only hyperlink turned on (using the path: ..\..\Samples\TOC\Samples.pdf ?/A Page=3=OpenActions). However, when I try to use the script above it opens the image path but no longer can open the pdf path. 

I have to send this to a client so I don't want any script to be dependent on a version of adobe either (I've seen that written into some codes). 

Thank you!

0 Kudos
1 Reply
RichardDaniels
Occasional Contributor III

Beware that with new versions of Edge and Chrome the file:// option is no no longer implemented. Solution is to place the pdfs on a web server and use http:// or https:// file paths to the PDF.

0 Kudos