Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default go to a page in a pdf file


I have read some of the posts about how to open up a pdf file (shell
command). Does anyone know how to open a pdf file and go to a specified page
in the pdf file?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default go to a page in a pdf file



Looks like you might be able to do it from a hyperlink:

'Link from an HTML page to a specific page in PDF file (Acrobat 7.x,
Acrobat 3D)' (http://kb2.adobe.com/cps/317/317300.html)

although Excel may not support that kind of hyperlink - if not you
might need to put an IE control on an Excel userform and work through
that.

Alternately,

'PDF and VBA Code Help - Access World Forums'
(http://www.access-programmers.co.uk/...d.php?t=100665)

presents code that (reportedly works) but you will probably need to
download and add to your project a reference to an OLE from Adobe (I
don't know where to download it - try a Google or Bing search on Adobe
OLE and see what comes up).

Good luck on this :Bgr and report back here when you get it working!


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=109374

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default go to a page in a pdf file

I cannot get the hyperlink to work - i've tried:
=HYPERLINK("\\server.com\file.pdf#page=2")
=HYPERLINK("\\server.com\file.pdf#nameddest=bookma rkname")
=HYPERLINK("F:\server.com\file.pdf#page=2")
=HYPERLINK("F:\server.com\file.pdf#nameddest=bookm arkname")

(Is a bookmark the same as a named destination?)

But if I type in \\server.com\file.pdf#page=2 in IE it works fine. Maybe
the IE control on an excel userform would work. Could you explain a little
more about that to get me in the right direction?

Thanks

"jamescox" wrote:


Looks like you might be able to do it from a hyperlink:

'Link from an HTML page to a specific page in PDF file (Acrobat 7.x,
Acrobat 3D)' (http://kb2.adobe.com/cps/317/317300.html)

although Excel may not support that kind of hyperlink - if not you
might need to put an IE control on an Excel userform and work through
that.

Alternately,

'PDF and VBA Code Help - Access World Forums'
(http://www.access-programmers.co.uk/...d.php?t=100665)

presents code that (reportedly works) but you will probably need to
download and add to your project a reference to an OLE from Adobe (I
don't know where to download it - try a Google or Bing search on Adobe
OLE and see what comes up).

Good luck on this :Bgr and report back here when you get it working!


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=109374


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default go to a page in a pdf file

Correction on the last post - For the last two hyperlinks, I meant to put
(without server.com):
=HYPERLINK("F:\file.pdf#page=2")
=HYPERLINK("F:\file.pdf#nameddest=bookmarkname")

(these do not work)

"Asbest" wrote:

I cannot get the hyperlink to work - i've tried:
=HYPERLINK("\\server.com\file.pdf#page=2")
=HYPERLINK("\\server.com\file.pdf#nameddest=bookma rkname")
=HYPERLINK("F:\server.com\file.pdf#page=2")
=HYPERLINK("F:\server.com\file.pdf#nameddest=bookm arkname")

(Is a bookmark the same as a named destination?)

But if I type in \\server.com\file.pdf#page=2 in IE it works fine. Maybe
the IE control on an excel userform would work. Could you explain a little
more about that to get me in the right direction?

Thanks

"jamescox" wrote:


Looks like you might be able to do it from a hyperlink:

'Link from an HTML page to a specific page in PDF file (Acrobat 7.x,
Acrobat 3D)' (http://kb2.adobe.com/cps/317/317300.html)

although Excel may not support that kind of hyperlink - if not you
might need to put an IE control on an Excel userform and work through
that.

Alternately,

'PDF and VBA Code Help - Access World Forums'
(http://www.access-programmers.co.uk/...d.php?t=100665)

presents code that (reportedly works) but you will probably need to
download and add to your project a reference to an OLE from Adobe (I
don't know where to download it - try a Google or Bing search on Adobe
OLE and see what comes up).

Good luck on this :Bgr and report back here when you get it working!


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=109374


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default go to a page in a pdf file


Assuming you are working out of Excel, this will do it:


Public Sub PDFPageViaIE(strUrl as String)

Dim ie As InternetExplorer

Set ie = New InternetExplorer

On Error Resume Next

ie.navigate strURL

Do

DoEvents

Loop Until ie.readyState = READYSTATE_COMPLETE


Set ie = Nothing

End Sub


where strURL is in the form of

F:\server.com\file.pdf#page=2

or

\\server.com\file.pdf#page=2


or even

http://www.irs.gov/pub/irs-pdf/fw4.pdf#page=2 (my test file :Bgr )

Of course, this does open it in an Internet Explorer browser window -
and it may be a new tab in an existing IE window if you have one already
open. The .Navigate method may accept parameters that force it to use a
new window - you can look for that, if you feel you need that
functionality.


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=109374



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default go to a page in a pdf file

Thanks, it works great!

Is there a way to navigate to different pages without having to create a new
object every time? I tried to create an object variable that I can reuse
with another procedure but it does not work for the second procedure. Here
is my code:

Static Sub PDFPageViaIE()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
Const strURL As String = "F:\server.com\file.pdf#page=2"
ie.navigate strURL
ie.Visible = True
End Sub

Static Sub PDFPageViaIESecondPage()
Const strURL2 As String = "F:\server.com\file.pdf#page=5"
ie.navigate strURL2
ie.Visible = True
End Sub

"jamescox" wrote:


Assuming you are working out of Excel, this will do it:


Public Sub PDFPageViaIE(strUrl as String)

Dim ie As InternetExplorer

Set ie = New InternetExplorer

On Error Resume Next

ie.navigate strURL

Do

DoEvents

Loop Until ie.readyState = READYSTATE_COMPLETE


Set ie = Nothing

End Sub


where strURL is in the form of

F:\server.com\file.pdf#page=2

or

\\server.com\file.pdf#page=2


or even

http://www.irs.gov/pub/irs-pdf/fw4.pdf#page=2 (my test file :Bgr )

Of course, this does open it in an Internet Explorer browser window -
and it may be a new tab in an existing IE window if you have one already
open. The .Navigate method may accept parameters that force it to use a
new window - you can look for that, if you feel you need that
functionality.


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=109374


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Excel 2010 files as web page or single file web page Joe Artis Excel Discussion (Misc queries) 3 April 29th 23 03:44 AM
Copy a page from an xla file Andrew Bourke[_2_] Excel Programming 2 June 30th 08 09:59 PM
how to print file address of the file on page? Ginette Excel Worksheet Functions 2 September 1st 06 10:43 PM
Get header only on first page of multi page excel file betwms Excel Discussion (Misc queries) 3 March 29th 06 05:47 PM
Setting a password on a Single File Web Page (mht; mhtml file) sinplicity Excel Discussion (Misc queries) 0 November 3rd 05 02:59 PM


All times are GMT +1. The time now is 09:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"