Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XP Style FileOpen dialog with multiple selection. 2

Status
Not open for further replies.

Mike Gagnon

Programmer
Apr 6, 2002
8,067
CA

For those of you using windows XP (and Windows Scripting 5.6), here is a nice and useful FileOpen dialog that exposes the usrmgr.cpl from the Control Panel.
Code:
oDlg= Createobject("userAccounts.commonDialog")
oDlg.flags= "&h1a04"
oDlg.Filter= "All Files|*.*|"+ "Text and Batch Files|*.txt;*.bat"
oDlg.filterIndex= 2
oDlg.initialDir="C:\"
qSln= oDlg.showOpen
If qSln
	Messagebox(oDlg.fileName)
Else
	Messagebox("Dialog cancelled.")
Endif

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Great work Mike - This is especially beneficial to those that run the same import (or other routine) over and over and select a different file each time.

*4U

Note: the data is brought back in one string and needs to be parsed. For those not familiar with how to do that check out: faq184-4326 Parsing Delimited Text



Jim Osieczonek
Delta Business Group, LLC
 
jimoo

Thank you for the star. Yes it would be very useful for that purpose.




Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Very nice Mike.

You must sit in front of your computer a lot :)

Darrell
 
Mike,

Excellent job! Star for you.

Slighthaze = NULL
craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon​
 
darrellblackhawk

You must sit in front of your computer a lot

Besides, I'm not a football fan...


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 


And probably the equivalent function at the opposite end would be:
Code:
oDlg= createObject("safrcFileDlg.fileSave")
oDlg.fileName= "C:\*.*"
oDlg.fileType= "Any File Type"




Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top