Refreshing Files/Opening files

#1)  I have an application that I am creating, similiar to that of the Windows Explorer. Whenever I choose a file to open or rename or something of that nature, when that task is done, that is the only file that shows in the File List box. This happens when there are other files in the same directory. How can I display the rest of the files as well?

I have tried refreshing the File List ctrl, Drive crtl, the form itself, everything. I am stumped.


#2 How can you open any MS Office file (Word, Access, Excel, Powerpoint, Outlook), as well as any other file that is of ASCII text origin?

For this one, I have tried the ShellExecute, and it only opens txt files. Code below:

 Dim ret As Long
 ret = ShellExecute(Me.hwnd, vbNullString, File1.FileName, vbNullString, CurDir, 1)
           

* File1.FileName is the file to be opened from the list box
slimbxAsked:
Who is Participating?
 
viktornetConnect With a Mentor Commented:
#1) could you show us the code you're using for this?
#2) try something like this....

call ShellExecute(0, "open", "Word.exe", "MyFile.txt", vbNullString, SW_SHOWNORMAL)

btw- you don't need the extension EXE after WORD, just to show you that Word is the executable which should open the file... MyFile.txt is the one that should be displayed in Word.exe

P.S. remember that the program you're trying to open your program with should be able to handle command line arguments and use them appropriatelly...

..-=ViKtOr=-..
0
 
slimbxAuthor Commented:
viktornet-

   I figured out the refresh problem that I was having. I was refreshing the wrong File List (dumb mistake). The answer you provided was excellent. Thanks alot.

slimbx

0
 
viktornetCommented:
>>I was refreshing the wrong File List

hehe, happens to me every once in a while ;-))

-vik-
0
All Courses

From novice to tech pro — start learning today.