-
I know how to associate my program with a file-format in the registry but I don't know how to open the file in VB6. I think I need to use left(string, lenght as long) in the Sub Main but I have no idea how I should do it. Can somebody help me please???!!!
ThAnX
-
I'm not quite getting what you want to do.
Do you want to create a buffer, add text, and then trim it back down?
If that's what you want to do, here's how to do it:
Code:
Dim Buffer As String
Buffer = Space$(256) 'Add 256 spaces
'Modify Buffer the way you want to
Buffer = Trim$(Buffer) 'Remove spaces
Is this what you want?
-
OK maybe I wasn't clear enough with my question, I'll try it again.
When you click for example a vb project-file in explorer vb will be loaded and the project file will be opened. Well, that's what I want to do, when someone clicks a file with my extension I want it to be opened with my program. I already know how to add the extension to the registry and send a command to my program but I don't know how to load the clicked file. The only thing that happens is my program that loads and the file I clicked is not opened.
I hope this is a little bit more clear.
-
Use the Command$ function, it will return all command parameters, (separated with space so you could use split function to split them up) therfore when you click command will return the filename(s)
-
Thanx but I don't realy understand it (I'm just a beginner). Could you please send me a clear example code, please...
-
Here's an example, should enumerate all Filenames in the For Each loop.
Code:
Private Sub Form_Load()
Dim Filenames, Filename
Filenames = Split(Command, " ")
For Each Filename In Filenames
MsgBox Filename
Next Filename
End Sub