Open PDF File Using Reader 8

M

Marvin

I was opening PDF Documentation Using the following Excel commands...
Dim strAdobeAppPath As String
Dim strAdobeFullName As String
Dim strAppFileToOpen As String
Dim AdobeValue As Long

strAdobeAppPath = "C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe"
strAdobeFullName = "C:\CRISNET\EXPORT\CMA_ToolKit_Default
Files\Real_Estate_Agent_Tool_Kit_Documentation.pdf"
strAppFileToOpen = strAdobeAppPath & " " & strAdobeFullName
AdobeValue = Shell(strAppFileToOpen, vbNormalFocus)

This stopped working with a "File not found" in Adobe Reader Version 8. Any
Suggestions would be greatly appreciated. The file can be opened successfully
using explorer.
 
J

Jim Cone

The most obvious thing is that the file path refers to 6.0 but your post says
you are using version 8.
(for what it is worth, FoxIt Reader opens PDF files much, much faster)
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Marvin" <[email protected]>
wrote in message
I was opening PDF Documentation Using the following Excel commands...
Dim strAdobeAppPath As String
Dim strAdobeFullName As String
Dim strAppFileToOpen As String
Dim AdobeValue As Long

strAdobeAppPath = "C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe"
strAdobeFullName = "C:\CRISNET\EXPORT\CMA_ToolKit_Default
Files\Real_Estate_Agent_Tool_Kit_Documentation.pdf"
strAppFileToOpen = strAdobeAppPath & " " & strAdobeFullName
AdobeValue = Shell(strAppFileToOpen, vbNormalFocus)

This stopped working with a "File not found" in Adobe Reader Version 8. Any
Suggestions would be greatly appreciated. The file can be opened successfully
using explorer.
 
M

Marvin

Soory for the confusion. It was working in version 6 thus the example code.
It no longer works in Version 8 using all of the correct paths and exe file
names. I will also try Foxit but I am going to distribute this software and
most people use the adobe software
 
J

Jim Cone

Another way...
'If you use the shellexecute API the API determines the program to use.
'Declaration goes at top of module.

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA"_
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String,ByVal nShowCmd As Long) As Long

'Use it like this...
Sub OpenInDefaultApp(FullName As String)
ShellExecute 0, vbNullString, FullName, 0&, 0&, 1
End Sub

'Call it like this...
Sub TestMe()
OpenInDefaultApp "C:\Program Files\Adobe\Acrobat 8.0\Acrobat\Acrobat.exe"
End Sub
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Marvin" <[email protected]>
wrote in message
Soory for the confusion. It was working in version 6 thus the example code.
It no longer works in Version 8 using all of the correct paths and exe file
names. I will also try Foxit but I am going to distribute this software and
most people use the adobe software
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top