Library tutorials & articles
File Assocation
By James Crowley, published on 14 Jul 2001
Page 3 of 4
- Introduction
- File Associaton
- Command Line Parameters
- Command Line Parameters And MDI Applications
Command Line Parameters
You will have noticed that so far your program does not open the file. Explorer passes the file path to your program when it starts, and you can access this through the Command$ function.
Private Sub Form_Load()
'// check command line argument:
If Command$ <> Empty Then
'// we have a file to open
OpenFile Command$ '// call your
openfile procedure
End If
End Sub
Related articles
Related discussion
-
Automating Excel from VB6.0
by epurdy (0 replies)
-
VB6 system conversion using VBA to Word 2007
by b.macgregor@vodamail.co.za (0 replies)
-
video not working with visual basic
by Jupiter 2 (9 replies)
-
Hyperterminal Data
by sengreen (1 replies)
-
vb6 - custom font
by Ruffsta3 (0 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
Hi Can you please also tell how to do it in .Net using VB.Net or C# ...
This looks like it could be the answer to my problem, but in case i stuff it up somehow could you tell me how to reverse the changes that are made to the registry by this code please?
Thanks
please help me..,
i have problem, i can't load file word (*.doc) from vb, can u tell me how to do it??
thx b4.
please send ur coding to niel_onggan@yahoo.com
The code is working fine, except for the OpenFile bit.
The comment says to call your openfile procedure.
What is the OpenFile command?
In using implimens this process into an application, I noticed the following line:
ret = RegSetValue&(lphKey, "shellopencommand", REGSZ, sKeyValue, MAXPATH)
did not properly register the association. I am using Windows 98 and had to change the above line to:
ret = RegSetValue&(lphKey, "shell\open\command", REGSZ, sKeyValue, MAXPATH)
to get it to work properly.
This thread is for discussions of File Assocation.