View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 923
Default Opening a PDF file

Hi,
How about if the path or version of Acrobat is unknown - Is there a method
to open the PDF?

I have a number of remote users and cannot guarantee that the Acrobat reader
is up to date or installed, and if it is in the same place! Worst of
everything I think. I want to provide a help file in PDF format that from
Excel than can open directly.

--
Cheers
Nigel



"T-®ex" wrote in message
...

Hi! Yes, you can change it to a sub. I made it a function so it'd be
more generalized and can be used in other situation. anywayz... the
return code isn't really important. it returns the task ID if open is
successful, 0 if unsuccessful. in the function, you pass your pdf file
as the argument.
to test it, you can create a subroutine that uses this:

sub TestOpen()
if OpenPDFFile("C:\MyPDF.pdf") 0 then
msgbox "successful!"
else
msgbox "uh... oh..."
end if
end sub

hope i was able to help... :)

Andrew Wrote:
Hi T-Rex,

Thanks but still not too sure how to run the Function - I normally just
use
subroutines. Can this be adapted? I have put in my path but where in
this
functiion do I insert my filename? Thanks in advance.

--
Andrew


"T-®ex" wrote:


Hi! Maybe this can help...

Function OpenPDFFile(PDFFile As String) As Double
OpenPDFFile = Shell("C:\Program Files\Adobe\Acrobat
6.0\Reader\AcroRd32.exe " & PDFFile, vbNormalFocus)
End Function

You should change "C:\Program Files\Adobe\Acrobat
6.0\Reader\AcroRd32.exe " to your appropriate adobe install path.

*Mind
the SPACE after the application name (AcroRd32.exe<SPACE_HERE).*

;)

Andrew Wrote:
Hi,

Can someone please assist with a way of opening an Adobe Acrobat

Reader
PDF
file. If Adobe isn't open do I need to I need to 'shell' to it

first?
--
Andrew


--
T-®ex

------------------------------------------------------------------------
T-®ex's Profile:

http://www.excelforum.com/member.php...o&userid=26572
View this thread:

http://www.excelforum.com/showthread...hreadid=398810




--
T-®ex
------------------------------------------------------------------------
T-®ex's Profile:

http://www.excelforum.com/member.php...o&userid=26572
View this thread: http://www.excelforum.com/showthread...hreadid=398810