borderAndreaVB free resources for Visual Basic developersborder

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

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Crystal REport Preferrable Version)Next Topic (Query) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Listung Files of folder
Poster Message
rajajihai
Level: Trainee

Registered: 05-09-2006
Posts: 1

icon Listung Files of folder

Hi All,

I need a favor from from you.

Below is the problem:

In a folder there are a lot of files reside. Now I have to take first file and check it's xtension and open it in it's native application.

For example, Folder name is "RajMac" and files are "1.doc", "2.xls", "3.ppt" etc.

I need a program in VB 6 so it check for xtension and open in Word, Excel, and in Power Point without user intervention.

Please do some needful if anyone can.

Thanks
RajMac


____________________________
Just say Hi

05-09-2006 at 04:27 PM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1616
icon Re: Listung Files of folder

To just open a file in the associated program:


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
Const SW_SHOWNORMAL = 1

Private Sub Form_Load()
    ShellExecute Me.hwnd, vbNullString, "path & filename", vbNullString, "C:\", SW_SHOWNORMAL

End Sub



____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

05-09-2006 at 08:15 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB General : Listung Files of folder
Previous Topic (Crystal REport Preferrable Version)Next Topic (Query) New Topic New Poll 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