Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Opening file / VB6
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Megatokyoguy




PostPosted: Fri May 30, 2008 11:33 am   Post subject: Opening file / VB6

I've used the shell command to try and open files, eg;

Shell "Whatever_File.txt", vbNormalFocus

It works fine, but it can only open specific files such as .exe's and .txt's. I can get it to open images by using something like;

Shell "C:\WINDOWS\SYSTEM32\MSPAINT.EXE Whatever_File.bmp", vbNormalFocus

Now the problem with shell commands is that they can only open specific types of files, and others only if you specificy a program that will open them (like above). On of that, it does not support spaces in the directory\file!

I want it to open files through VB the same way as Windows Explorer does, such as double clicking, & the particular file opens with the default program. I have tried the ShellExecute command & was not able to make it work. Is there an alternative to shell?
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: