?
Solved

Refreshing Files/Opening files

Posted on 1999-06-26
3
Medium Priority
?
138 Views
Last Modified: 2012-05-04
#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
0
Comment
Question by:slimbx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
viktornet earned 120 total points
ID: 1519958
#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
 

Author Comment

by:slimbx
ID: 1519959
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
 
LVL 10

Expert Comment

by:viktornet
ID: 1519960
>>I was refreshing the wrong File List

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

-vik-
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question