Help Please!! FollowHyperLink doesn't work with Adobe Reader; why

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

I'm using the Application.FollowHyperLink function to open .pdf files. But
it doesn't work if the PC has only the Adobe Reader version. I already try
it with the Standard and Pro version and it works. Why it doesn't work with
the Reader??

Here's the code:

Public Function GetAddress(StrInput As Variant) As Boolean

On Error GoTo Error_GetAddress
Application.FollowHyperlink StrInput, , True
GetAddress = True
....

Here's where i call Get_Address function:
For i = 0 To Me.LstReport.ItemsSelected.Count - 1
idx = Me.LstReport.ItemsSelected.Item(i)
strRptName = Me.LstReport.Column(1, idx)
Call MiscFunctions.GetAddress(strRptName)
Next
.....

The only function that works for Adobe Reader was the Shell:

Call Shell("""C:\Program Files\Adobe\Acrobat 7.0\Reader\acrord32.exe "" " &
strRptName & "", 1)

But i don't want to specify the Adobe version hardcoded...

Please Help!!!

Thanks in advance...!
A. Pach
 
Hello A.

A. Pach said:
Hi!

I'm using the Application.FollowHyperLink function to open .pdf files.
But it doesn't work if the PC has only the Adobe Reader version.
I already try it with the Standard and Pro version and it works.
Why it doesn't work with the Reader??

I think the reader must be configured to show PDFs in the browser.
(Located at something like Edit/Settings/Internet)
Here's the code: [...]
The only function that works for Adobe Reader was the Shell:

Call Shell("""C:\Program Files\Adobe\Acrobat 7.0\Reader\acrord32.exe"" "
& strRptName & "", 1)

But i don't want to specify the Adobe version hardcoded...

Call Shell("CMD /C """ & strRptName & """", 0)
This will open the program registered to for the pdf filename extension.
 
Thanks Wolfgang for your help!!

I'm trying to use your suggestion but is giving me "File not Found". Do i
need to add a Ref/lib for the use of CMD /C...?

A. Pach

Wolfgang Kais said:
Hello A.

A. Pach said:
Hi!

I'm using the Application.FollowHyperLink function to open .pdf files.
But it doesn't work if the PC has only the Adobe Reader version.
I already try it with the Standard and Pro version and it works.
Why it doesn't work with the Reader??

I think the reader must be configured to show PDFs in the browser.
(Located at something like Edit/Settings/Internet)
Here's the code: [...]
The only function that works for Adobe Reader was the Shell:

Call Shell("""C:\Program Files\Adobe\Acrobat 7.0\Reader\acrord32.exe"" "
& strRptName & "", 1)

But i don't want to specify the Adobe version hardcoded...

Call Shell("CMD /C """ & strRptName & """", 0)
This will open the program registered to for the pdf filename extension.
 
Hey Wolfgang, Never mind it works... it was a space between D and /.

Thank you so much!!!

Wolfgang Kais said:
Hello A.

A. Pach said:
Hi!

I'm using the Application.FollowHyperLink function to open .pdf files.
But it doesn't work if the PC has only the Adobe Reader version.
I already try it with the Standard and Pro version and it works.
Why it doesn't work with the Reader??

I think the reader must be configured to show PDFs in the browser.
(Located at something like Edit/Settings/Internet)
Here's the code: [...]
The only function that works for Adobe Reader was the Shell:

Call Shell("""C:\Program Files\Adobe\Acrobat 7.0\Reader\acrord32.exe"" "
& strRptName & "", 1)

But i don't want to specify the Adobe version hardcoded...

Call Shell("CMD /C """ & strRptName & """", 0)
This will open the program registered to for the pdf filename extension.
 
I have the same problem that the person that asked this question had. Im
trying to use the shell function thats posted. I keep getting a file not
found message. Whats the logic behind the "cmd/c" part of the shell
statement?

Shell("cmd/c""" & me.link_to_re & """", 0)

When i go back to VB to debug, i see that the "me.link_to_re" part of the
statement shows the full location of the document with the drive letter.

Wolfgang Kais said:
Hello A.

A. Pach said:
Hi!

I'm using the Application.FollowHyperLink function to open .pdf files.
But it doesn't work if the PC has only the Adobe Reader version.
I already try it with the Standard and Pro version and it works.
Why it doesn't work with the Reader??

I think the reader must be configured to show PDFs in the browser.
(Located at something like Edit/Settings/Internet)
Here's the code: [...]
The only function that works for Adobe Reader was the Shell:

Call Shell("""C:\Program Files\Adobe\Acrobat 7.0\Reader\acrord32.exe"" "
& strRptName & "", 1)

But i don't want to specify the Adobe version hardcoded...

Call Shell("CMD /C """ & strRptName & """", 0)
This will open the program registered to for the pdf filename extension.
 
I only have Acrobat Reader on my machine, and FollowHyperlink works fine for
me.

cmd /c invokes an instance of the Windows command interpreter. The space
between cmd and /c is critical. What operating system are you using, though?
On older OS, it's command, not cmd. To write a more generic approach, use:

Shell(Environ$("ComSpec") & " /c""" & me.link_to_re & """", 0)

A third alternative is to use the ShellExecute API. There's a complete
example at http://www.mvps.org/access/api/api0018.htm at "The Access Web"

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


tope12 said:
I have the same problem that the person that asked this question had. Im
trying to use the shell function thats posted. I keep getting a file not
found message. Whats the logic behind the "cmd/c" part of the shell
statement?

Shell("cmd/c""" & me.link_to_re & """", 0)

When i go back to VB to debug, i see that the "me.link_to_re" part of the
statement shows the full location of the document with the drive letter.

Wolfgang Kais said:
Hello A.

A. Pach said:
Hi!

I'm using the Application.FollowHyperLink function to open .pdf files.
But it doesn't work if the PC has only the Adobe Reader version.
I already try it with the Standard and Pro version and it works.
Why it doesn't work with the Reader??

I think the reader must be configured to show PDFs in the browser.
(Located at something like Edit/Settings/Internet)
Here's the code: [...]
The only function that works for Adobe Reader was the Shell:

Call Shell("""C:\Program Files\Adobe\Acrobat 7.0\Reader\acrord32.exe"" "
& strRptName & "", 1)

But i don't want to specify the Adobe version hardcoded...

Call Shell("CMD /C """ & strRptName & """", 0)
This will open the program registered to for the pdf filename extension.
 
Back
Top