Opening pdf's from Excel

G

Guest

Hi there.

I've got a "Menu" worksheet that has a listbox on it. The listbox contains a
list of the files in a networked folder elsewhere and is populated using
application.FileSearch.
These are all Word documents and the user can open them my double clicking
in the item in the listbox.

I use
Set wdApp = CreateObject("Word.Application") etc to open Word and then open
the file. This works well for all users who use a mix of XP and Windows 2000.

The problem is that the Word documents in the aforementioned folder are
likely to be converted to pdf's. I've tested the listbox by populating it
from a folder with pdf files and using Tom Ogilvy's code to open it.

Sub Tester2a()
Shell "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" & _
" c:\toc1\amcr37-4.pdf", 1
End Sub


This works for the windows 2000 users with Adobe Reader 7, but not for XP
users with Adobe Reader 8.
Adobe Reader 8 opens but displays a message box "File Not Found".

Is there any way to allow for different versions and paths of Adobe Reader,
perhaps using CreateObject as with Word?

Many thanks in advance.
L
 
J

Jim Rech

I just ran this and it was fine:

Shell "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe" & "
c:\LitchfieldTour.pdf", 1

Make sure the PDF file actually exists where specified.

--
Jim
| Hi there.
|
| I've got a "Menu" worksheet that has a listbox on it. The listbox contains
a
| list of the files in a networked folder elsewhere and is populated using
| application.FileSearch.
| These are all Word documents and the user can open them my double clicking
| in the item in the listbox.
|
| I use
| Set wdApp = CreateObject("Word.Application") etc to open Word and then
open
| the file. This works well for all users who use a mix of XP and Windows
2000.
|
| The problem is that the Word documents in the aforementioned folder are
| likely to be converted to pdf's. I've tested the listbox by populating it
| from a folder with pdf files and using Tom Ogilvy's code to open it.
|
| Sub Tester2a()
| Shell "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" & _
| " c:\toc1\amcr37-4.pdf", 1
| End Sub
|
|
| This works for the windows 2000 users with Adobe Reader 7, but not for XP
| users with Adobe Reader 8.
| Adobe Reader 8 opens but displays a message box "File Not Found".
|
| Is there any way to allow for different versions and paths of Adobe
Reader,
| perhaps using CreateObject as with Word?
|
| Many thanks in advance.
| L
|
 

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