Quote:
>When a file of a certain type is double clicked on, my app opens. The app
>needs to know the full path of the file how can I get this? Also, I need
the
>app to get the first part of a file name, the part before the extension,
and
>make a subfolder from it.
Well, there are two things you need to do ...
1. register the file, you want to open in your VB app, so that it's
extension is 'connected' to the app ... you can do this in Folder Options >
File Types... There you add the extension of you datafile and add a new
action to so that the file is "OPEN"ed with your application.
2. Your application must accept these commandline arguments which contain
the full pathname of the file which issued the call to the application.
< --- code starts here --- >
Private DataFileFP As String
Private DataFilePath As String
Private DataFileName As String
Private Sub Form_Load()
DataFileFP = Command
' find last backslash
pos = 0
While InStr(pos + 1, DataFileFP, "\") <> 0
pos = InStr(pos + 1, DataFileFP, "\")
Wend
DataFilePath = Left$(DataFileFP, pos)
DataFileName = Left$(Mid$(DataFileFP, pos + 1), InStr(1,
Mid$(DataFileFP, pos + 1), "."))
End Sub
< --- code ends here --- >
after which
DataFileFP contains the Full Path to the datafile
DataFilePath contains the Path to the datafile
DataFileName contains the name of the datafile, without the extension ...
hope this helps
greetz
Christophe