borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB Home | News Home | Forum Home | Downloads | Register | Search | PM | Profile

Previous Topic (No Value Given For One Or more Parameters)Next Topic (timer speeds on different computers) New Topic Post Reply
AndreaVB OnLine : VB General : cannot open pdf doc from VB
Poster Resource
Sekar
Level: Sage

Registered: 11-03-2004
Posts: 63
icon 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
View Profile Send Email to User Show All Posts | Add Comment
LFC8
Level: Scholar

Registered: 07-12-2004
Posts: 38
icon 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
View Profile Send Email to User Show All Posts | Add Comment
iliekater
Level: Master

Registered: 04-02-2005
Posts: 123
icon 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
View Profile Send Email to User Show All Posts | Add Comment
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon 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
OpenFile "myfile.pdf"

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
View Profile Send Email to User Show All Posts | Add Comment
AndreaVB OnLine : VB General : cannot open pdf doc from VB
Previous Topic (No Value Given For One Or more Parameters)Next Topic (timer speeds on different computers)New Topic Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder