English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i need to a code on how 2 open file in any path. it can be either c:\, d:\ or even in network...

this is the code u have

Shell ("C:\ask.txt")

but it is not working....can anyone plz help me tell me how to do about it...thx

2006-07-16 16:31:23 · 3 answers · asked by deepzzz 2 in Computers & Internet Programming & Design

3 answers

Hey! u r almost on the right track, but too far away.
Just try to remove the brackets and then go for it....still wont work.

Try this example
---------------------
Shell "notepad c:\ask.txt", vbNormalFocus

This will surely be solving the problem...but trust me this is not the correct way.
There are long codes and api's that u need to write for opening a file with the associated application. The above example...will open the files in notepad only.

2006-07-16 17:59:00 · answer #1 · answered by Chandan 1 · 0 0

Hopefully this will help, I be live this was the same code I used in one of my earlier projects.

Oh Good Luck on your project, and congratulations on being one of the few people on this site that actually do their on work (not sarcasm) and ask for help only when they need it. Good Luck, and enjoy the venture into computer programming.

FYI, it doesnt hurt to join a programming forum when your just starting out, it actually helps alot. Yahoo also does have a decent chat room where people are somewhat willing to give you a hand.

2006-07-16 16:45:05 · answer #2 · answered by D 4 · 0 0

Try this simple one:

Call Shell("notepad c:\ask.txt", vbNormalFocus)

Cheers!

NOTE: (1) added CALL; (2) this is "SIMPLE" and short one (and NOT "LONG" one which includes lots of APIs, etc.); (3) It WORKS for me, it will WORK also for those with Visual Basic system and try this SIMPLE one (1) line of code!!!

2006-07-16 16:48:00 · answer #3 · answered by VBACCESSpert 5 · 0 0

fedest.com, questions and answers