 |
Sekar Level: Sage
 Registered: 11-03-2004 Posts: 63
|
cannot open pdf doc from VB
We are using vb application, from the vb application the customer is able to open a .pdf file Adobe version 5.5. The customer uninstall the Adobe version 5.5 and install Adobe 7.7 he is not able to open the .pdf from the vb application software. I am try to duplicate this problem for the past two days no solution. The client is using citrix environment. Please vb experts do help.
|
|
19-05-2006 at 09:21 PM |
|
|
LFC8 Level: Scholar
 Registered: 07-12-2004 Posts: 38
|
Re: cannot open pdf doc from VB
Hi
Can't you use ShellExecute?
cFileName = "C:\Your Doc"
ShellExecute(0,cAction,cFileName,"","",1)
HTH
|
|
31-05-2006 at 11:33 AM |
|
|
iliekater Level: Master
 Registered: 04-02-2005 Posts: 123
|
Re: cannot open pdf doc from VB
I get some errors when using this code.
If I use it exactly as it's given , the editor draws the following line :
ShellExecute(0,cAction,cFileName,"","",1)
in red color , which means there has to be a problen . When running the application , I get the error message "Syntax error" .
I tried something like this :
ShellExecute(0,cAction,cFileName,"","",1) = cFileName
but though it is no longer in red colour, it still has problem becouse when I run the app , I get the error message "No sub or function deined" refering to the "ShellExecute" function .
What's going wrong ?
|
|
01-07-2006 at 10:54 AM |
|
|
stickleprojects Level: Moderator

 Registered: 09-09-2002 Posts: 891
|
Re: cannot open pdf doc from VB
Hi,
You need to add the declare for ShellExecute to your code module.
Example.
Create a module and paste the following into it:
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Sub OpenFile(strFileName As String)
ShellExecute 0, "Open", strFileName, "", "", 1
End Sub
|
Then use
to open the file.
Hope this helps,
Kieron
____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)
|
|
02-07-2006 at 08:25 AM |
|
|
|
|
 |
 |