Opening PDF file from VBA code in Win98

S

Stefano M

Hi all,
i need to open a PDF file via VBA code.
In Win2000/XP i'm able to do it with:
ret = Shell(Environ$("COMSPEC") & " /c """ & list3.Column(3)
& """")
but it doesn't work in Win98, i think cause 'command.com' doesn't to handle
*.pdf file and 'cmd.exe' yes !
How can i solve ?
i'd like to solve it with a code that doesn't know the Acrobat Reader path
!!

Thanks
 
A

Andi Mayer

Hi all,
i need to open a PDF file via VBA code.
In Win2000/XP i'm able to do it with:
ret = Shell(Environ$("COMSPEC") & " /c """ & list3.Column(3)
& """")
but it doesn't work in Win98, i think cause 'command.com' doesn't to handle
*.pdf file and 'cmd.exe' yes !
How can i solve ?
i'd like to solve it with a code that doesn't know the Acrobat Reader path
!!
check with the Environ$("COMSPEC") gives you
is the Acrobat registered on this PC
can you open a pdf from the DOS window?
 
S

Stefano M

For Win2000/XP is 'C:\WINNT\system32\cmd.exe'
but for Win98 is 'command.com'
In Win98 i'm not able to open pdf file from DOS window: this is my question!
:)
 
A

Andi Mayer

For Win2000/XP is 'C:\WINNT\system32\cmd.exe'
but for Win98 is 'command.com'
In Win98 i'm not able to open pdf file from DOS window: this is my question!
:)

and this question?
 
S

Stefano M

Andi Mayer said:
and this question?

What does it mean ?
On my pc the Reader is installed and every pdf files have the PDF document
icon.
If i double click on them, the Reader open them ...
 
A

Andi Mayer

What does it mean ?
On my pc the Reader is installed and every pdf files have the PDF document
icon.
If i double click on them, the Reader open them ...

this is the short way
look in the explorer options under file types
under pdf there should be a "open" and this gives you the syntac to
open a pdf like:
"C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe" "%1"

try this (excange the %1 with your document)
I don't have a 98 running to check it myself.
 
Top