hi frnds

here i found many solutions for vb

thanx for all your help

and now i came with a new problem

i have a file (doc,xls,txt, jpg or whtever it is)

here i have to open that file from vb

i have the filename

i cant imagine i have to create objects for each file type

is thr any specific functions thr for solve this (with Codes Plz)

i dont have any

plz help me

thank u

Hi,

Use the below code while changing just the file name:

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 Command1_Click()

    ShellExecute Me.hwnd, vbNullString, "[B]C:\temp.doc[/B]", vbNullString, "C:\", SW_SHOWNORMAL

End Sub

vow

really great

thank u

Very good coding... thanks....:)

Thanks very good coding realy great.....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.