Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
Anne98 25 ani
Femeie
25 ani
Buzau
cauta Barbat
25 - 50 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [EXCEL] Open Hyperlink to PDF File at a Specific Page Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 787
Your link can look like this:


If you are using PDF-XChange Editor free like I am:
"C:\Program Files\Tracker Software\PDF Editor\PDFXEdit.exe" /A "page=5;zoom=100" "D:\MY PDF FILES\PDF FILE 100.pdf"

In color are the parameters I used, see below link to more parameters. - The chapter called "Command line options"

If you are using Adobe Reader 64bit version (adapt Adobe Reader executable file if you have 32bit version):
"C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe" /A "page=5&zoom=100" "D:\MY PDF FILES\PDF FILE 100.pdf"

If you are using SumatraPDF - more command line options here:
"C:\....\SumatraPDF.exe" "D:\MY PDF FILES\PDF FILE 100.pdf" -page 3 -zoom 100

VBA codes for using PDF-XChange as PDF opening software:

In the sheet's code I added the following macro that runs hyperlink in cell A1 with page number in cell J1 to open the PDF file at that page. The hyperlink in cell A1 (CTRL+K) refers to a place in this document namely cell A1 (yes, it refers to itself but the macro makes the link open the PDF file).



Sub GoTo_Page_in_PDF()

Dim File As String
Dim Reader As String
Dim Pg As String
Dim cell As Range

Set cell = ActiveCell
Pg = cell.Offset(0, 9)
Reader = "C:\Program Files\Tracker Software\PDF Editor\PDFXEdit.exe"
File = "D:\MY PDF FILES\PDF FILE 100.pdf"

r = Shell(Reader & " /A page=" & Pg & " " & Chr(34) & File & Chr(34))

End Sub



Since my chapters are at the top, middle or bottom of a page, I added the [zoom, left, top] parameter and updated the above code to:


GoTo_Page_in_PDF()

Dim File As String
Dim Reader As String
Dim Pg As String
Dim cell As Range

Set cell = ActiveCell
Pg = cell.Offset(0, 9)
Reader = "C:\Program Files\Tracker Software\PDF Editor\PDFXEdit.exe"
File = "D:\MY PDF FILES\PDF FILE 100.pdf"

'r = Shell(Reader & " /A page=" & Pg & ";viewrect=0,400,700,700 " & Chr(34) & File & Chr(34))

Select Case cell.Offset(0, 10).Value

Case "sus"
    r = Shell(Reader & " /A page=" & Pg & ";zoom=100,0,0 " & Chr(34) & File & Chr(34))

Case "jos"
    r = Shell(Reader & " /A page=" & Pg & ";zoom=100,550,550 " & Chr(34) & File & Chr(34))
   
Case "mijloc"
    r = Shell(Reader & " /A page=" & Pg & ";zoom=100,250,250 " & Chr(34) & File & Chr(34))
   
End Select

End Sub


pus acum 2 ani
   
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 787
Made the following snippet to check for hyperlinks in a range, then call the GoTo macro above.


Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
''''''Set MyGroup = Application.Union(Range("A1:D1"), Range("F1:I1"), Range("K1"), Range("N1:P1"))
Set MyRng = Range("A132:A155")
If Not Intersect(ActiveCell, MyRng) Is Nothing Then
    Call GoTo_Page_in_PDF
    Exit Sub
End If
Set MyRng = Nothing

End Sub


pus acum 2 ani
   
Mrrrr
AdMiN

Inregistrat: acum 17 ani
Postari: 2228
updated post #1 with SumatraPDF syntax

_______________________________________


pus acum 1 an
   
Pagini: 1  

Mergi la