Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a PDF file
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a PDF file
Hi! Maybe this can help... Function OpenPDFFile(PDFFile As String) As Double OpenPDFFile = Shell("C:\Program Files\Adobe\Acroba 6.0\Reader\AcroRd32.exe " & PDFFile, vbNormalFocus) End Function You should change "C:\Program Files\Adobe\Acroba 6.0\Reader\AcroRd32.exe " to your appropriate adobe install path. *Min 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 Reade file. If Adobe isn't open do I need to I need to 'shell' to it first? -- Andre -- T-®e ----------------------------------------------------------------------- T-®ex's Profile: http://www.excelforum.com/member.php...fo&userid=2657 View this thread: http://www.excelforum.com/showthread.php?threadid=39881 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a PDF file
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 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a PDF file
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 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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a PDF file
sorry, can't help you with that... well... there's is a GetSetting function in VBA... maybe you can us this to query the registry (windows) to get the file path and name o acrobat... you can read about this in the help file.... Nigel Wrote: Hi, How about if the path or version of Acrobat is unknown - Is there method to open the PDF? I have a number of remote users and cannot guarantee that the Acroba 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 tha from Excel than can open directly. -- Cheers Nigel "T-®ex" wrote i 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 ope is successful, 0 if unsuccessful. in the function, you pass your pd 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 normall just use subroutines. Can this be adapted? I have put in my path but wher 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 instal path. *Mind the SPACE after the application nam (AcroRd32.exe<SPACE_HERE).* ;) Andrew Wrote: Hi, Can someone please assist with a way of opening an Adob Acrobat Reader file. If Adobe isn't open do I need to I need to 'shell' t 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 -- T-®e ----------------------------------------------------------------------- T-®ex's Profile: http://www.excelforum.com/member.php...fo&userid=2657 View this thread: http://www.excelforum.com/showthread.php?threadid=39881 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
opening a file in Excel starts application but dose not open file | Excel Discussion (Misc queries) | |||
Opening file in Excel 2003 opens multipule instances of same file | Excel Discussion (Misc queries) | |||
File:1 and File:2 -- Double Files when Opening One File | Excel Discussion (Misc queries) | |||
opening an excel file opens a duplicate file of the same file | Excel Discussion (Misc queries) |