Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 12-11-2016, 04:59 PM
poetofpiano poetofpiano is offline Macro to Go To Specific Page in Hyperlinked PDF Windows 8 Macro to Go To Specific Page in Hyperlinked PDF Office 2013
Novice
Macro to Go To Specific Page in Hyperlinked PDF
 
Join Date: Sep 2015
Posts: 25
poetofpiano is on a distinguished road
Default

Thank you so much gmayor. With your help, I was able to make it work:

Code:
Sub GoToPDFhyperlinkPage()
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)
End Sub

Public Function OpenPagePDF(sMyPDFPath As String, iMyPageNumber As Integer)
Dim RtnCode, AdobePath As String
AdobePath = Chr(34) & "C:\Program Files\SumatraPDF\SumatraPDF.exe" & Chr(34)
' need it enclosed in quotes b/c there is a space in "Program Files"
RtnCode = Shell(AdobePath & " " & Chr(45) & "page" & " " & iMyPageNumber & " " & Chr(45) & "reuse" & Chr(45) & "instance" & " " & Chr(34) & sMyPDFPath & Chr(34), 1)
End Function
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Go To Specific Page in Hyperlinked PDF Macro: How to get this macro to save to a specific location LOUF Word VBA 1 12-07-2015 06:47 PM
Macro to Go To Specific Page in Hyperlinked PDF Macro for word to add page break and specific text to end of document pizzaman1 Word VBA 6 11-14-2014 11:25 PM
Macro Needed to bold specific lines and Macro to turn into CSV anewteacher Word VBA 1 05-28-2014 03:59 PM
can I run a macro when I open a specific doc. shreked Word 8 01-12-2012 03:36 AM
Why isn't my hyperlinked word text hyperlinked when I convert it to pdf? Obisco Word 0 12-10-2010 01:58 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft