Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FollowHyperLink does not work for PDF 2

Status
Not open for further replies.

vpellerito

Technical User
Sep 12, 2006
30
US
Can anybody tell me why the FollowHyperLink method won't work for PDFs on my computer? It will work for Word documents but for PDFs it looks like it quickly brings up Adobe Acrobat Reader and then Reader quickly closes. It doesn't run as a process behind the scenes, it just closes before it even opens the PDF.

I'm using Adobe Acrobat Reader 7.0

Any help appreciated,
Thanks.
Vince
 

Two questions...
1. Can you open other PDF files manually?
2. What code are you using?


Randy
 
Yes, I can open up PDFs manually.
This is my code executed on the Click event of a bound textbox.

Code:
 strLink = CurPath & "\PDFs\" & Me.txtFileName.Value
Application.FollowHyperLink strLink
 
You might to want to add protocol type at the beginning. So the strLink will be like "file://c:\temp\x.pdf".

Another way to test is to copy "file://c:\temp\x.pdf" to the file explorer or IE to see whether it works.

Seaport
 
Thanks but adding the protocol type doesn't help.
However, the file path that is generated (strLink) with the protocol type does work in IE or Win Explorer.

Vince
 
Try this:

Code:
strLink = """ & CurPath & "\PDFs\" & Me.txtFileName.Value & """
Application.FollowHyperLink strLink, , True, False
 
I can open up PDFs manually
So, you may try this:
CreateObject("WScript.Shell").Run Chr(34) & strLink & Chr(34)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top