Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open file with foxit when adobe reader is default application
Hi,
I'd like to sometimes open pdf files with foxit reader, but want to keep the default reader Adobe Reader. At the moment I'm using this code: Sub OpenPdffile() Dim FSO Set FSO = CreateObject("Scripting.FileSystemObject") strHelpPath = "C:\pdffile.pdf" If FSO.FileExists(strHelpPath) Then StartDoc (strHelpPath) End If End Sub Function StartDoc(DocName As String) As Long Dim Scr_hDC As Long Scr_hDC = GetDesktopWindow() StartDoc = ShellExecute(Scr_hDC, "Open", DocName, _ "", "C:\", SW_SHOWNORMAL) End Function Is there anyone able (and willing ;-) ) to help me out? Poniente |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open file with foxit when adobe reader is default application
I don't have foxit reader on this pc.
But if this is just for you (or for people that have the same exact setup as you), maybe you can just do something like: Shell "c:\program files\foxitreaderfolder\foxitreader.exe " & strHelpPath You could add a check to verify that the reader is where you expect it. If not, then use the default application. Poniente wrote: Hi, I'd like to sometimes open pdf files with foxit reader, but want to keep the default reader Adobe Reader. At the moment I'm using this code: Sub OpenPdffile() Dim FSO Set FSO = CreateObject("Scripting.FileSystemObject") strHelpPath = "C:\pdffile.pdf" If FSO.FileExists(strHelpPath) Then StartDoc (strHelpPath) End If End Sub Function StartDoc(DocName As String) As Long Dim Scr_hDC As Long Scr_hDC = GetDesktopWindow() StartDoc = ShellExecute(Scr_hDC, "Open", DocName, _ "", "C:\", SW_SHOWNORMAL) End Function Is there anyone able (and willing ;-) ) to help me out? Poniente -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open file with foxit when adobe reader is default application
Thanks Dave for taking time to look into this!
When I implement your suggestion, Foxit does open, but the file unfortunately does not open. This is basically what I tried: Function StartDoc(DocName As String) As Long Shell "c:\program files\foxit software\foxit reader\foxit reader.exe C:\Download\" & DocName End Function When I copy this text in 'run' (start menu), the foxit reader does load with the file.. Hope there is anyone with a clue how to solve this one! Poniente On 11 jan, 15:11, Dave Peterson wrote: I don't have foxit reader on this pc. But if this is just for you (or for people that have the same exact setup as you), maybe you can just do something like: Shell "c:\program files\foxitreaderfolder\foxitreader.exe " & strHelpPath You could add a check to verify that the reader is where you expect it. *If not, then use the default application. Ponientewrote: Hi, I'd like to sometimes open pdf files with foxit reader, but want to keep the default reader Adobe Reader. At the moment I'm using this code: Sub OpenPdffile() * * Dim FSO * * Set FSO = CreateObject("Scripting.FileSystemObject") * * strHelpPath = "C:\pdffile.pdf" * * If FSO.FileExists(strHelpPath) Then * * * * StartDoc (strHelpPath) * * End If End Sub Function StartDoc(DocName As String) As Long * * Dim Scr_hDC As Long * * Scr_hDC = GetDesktopWindow() * * StartDoc = ShellExecute(Scr_hDC, "Open", DocName, _ * * "", "C:\", SW_SHOWNORMAL) End Function Is there anyone able (and willing ;-) ) to help me out? Poniente -- Dave Peterson- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open file with foxit when adobe reader is default application
Try quoting your paths
Sub StartDoc(DocName as string) Const FX_PATH as string = "c:\program files\foxit software\foxit reader\foxit reader.exe" Const CMD_TXT as string = """<rdrPath"" ""C:\Download\<docName""" Dim sCmd as string sCmd = Replace(CMD_TEXT,"<rdrPath",FX_PATH) sCmd = Replace(CMD_TEXT,"<docName",DocName) Shell sCmd end sub Tim "Poniente" wrote in message ... Thanks Dave for taking time to look into this! When I implement your suggestion, Foxit does open, but the file unfortunately does not open. This is basically what I tried: Function StartDoc(DocName As String) As Long Shell "c:\program files\foxit software\foxit reader\foxit reader.exe C:\Download\" & DocName End Function When I copy this text in 'run' (start menu), the foxit reader does load with the file.. Hope there is anyone with a clue how to solve this one! Poniente On 11 jan, 15:11, Dave Peterson wrote: I don't have foxit reader on this pc. But if this is just for you (or for people that have the same exact setup as you), maybe you can just do something like: Shell "c:\program files\foxitreaderfolder\foxitreader.exe " & strHelpPath You could add a check to verify that the reader is where you expect it. If not, then use the default application. Ponientewrote: Hi, I'd like to sometimes open pdf files with foxit reader, but want to keep the default reader Adobe Reader. At the moment I'm using this code: Sub OpenPdffile() Dim FSO Set FSO = CreateObject("Scripting.FileSystemObject") strHelpPath = "C:\pdffile.pdf" If FSO.FileExists(strHelpPath) Then StartDoc (strHelpPath) End If End Sub Function StartDoc(DocName As String) As Long Dim Scr_hDC As Long Scr_hDC = GetDesktopWindow() StartDoc = ShellExecute(Scr_hDC, "Open", DocName, _ "", "C:\", SW_SHOWNORMAL) End Function Is there anyone able (and willing ;-) ) to help me out? Poniente -- Dave Peterson- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open file with foxit when adobe reader is default application
Tim,
That did the trick. many thanks, Poniente On 26 jan, 03:18, "Tim Williams" wrote: Try quoting your paths Sub StartDoc(DocName as string) * * Const FX_PATH as string = "c:\program files\foxit software\foxit reader\foxit reader.exe" * * Const CMD_TXT as string = """<rdrPath"" ""C:\Download\<docName""" * * Dim sCmd as string * * sCmd = Replace(CMD_TEXT,"<rdrPath",FX_PATH) * * sCmd = Replace(CMD_TEXT,"<docName",DocName) * * Shell sCmd end sub Tim "Poniente" wrote in message ... Thanks Dave for taking time to look into this! When I implement your suggestion, Foxit does open, but the file unfortunately does not open. This is basically what I tried: Function StartDoc(DocName As String) As Long * *Shell "c:\program files\foxit software\foxit reader\foxit reader.exe C:\Download\" & DocName End Function When I copy this text in 'run' (start menu), the foxit reader does load with the file.. Hope there is anyone with a clue how to solve this one! Poniente On 11 jan, 15:11, Dave Peterson wrote: I don't have foxit reader on this pc. But if this is just for you (or for people that have the same exact setup as you), maybe you can just do something like: Shell "c:\program files\foxitreaderfolder\foxitreader.exe " & strHelpPath You could add a check to verify that the reader is where you expect it. If not, then use the default application. Ponientewrote: Hi, I'd like to sometimes open pdf files with foxit reader, but want to keep the default reader Adobe Reader. At the moment I'm using this code: Sub OpenPdffile() Dim FSO Set FSO = CreateObject("Scripting.FileSystemObject") strHelpPath = "C:\pdffile.pdf" If FSO.FileExists(strHelpPath) Then StartDoc (strHelpPath) End If End Sub Function StartDoc(DocName As String) As Long Dim Scr_hDC As Long Scr_hDC = GetDesktopWindow() StartDoc = ShellExecute(Scr_hDC, "Open", DocName, _ "", "C:\", SW_SHOWNORMAL) End Function Is there anyone able (and willing ;-) ) to help me out? Poniente -- Dave Peterson- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I get rid of Adobe Reader icon? | Excel Discussion (Misc queries) | |||
Opening a .pdf file with Adobe Reader 8.0 | Excel Programming | |||
Opening a pdf file with Adobe Reader | Excel Programming | |||
how i can take file from adobe reader and make it read with micr. | Excel Discussion (Misc queries) | |||
Identifying version of Adobe Reader | Excel Programming |