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!

Open folder from a mask

Status
Not open for further replies.

darkwraith

Programmer
May 26, 2003
44
IT
Hi, I should open a folder from a mask. In the folder there will be one or more pdf files, so I should display the file selected calling it by my access mask.
How to do?
Thanks in advance,
Elena
 
Hi

If I undersatnd you correctly, you could do this two ways,

if you want to browse folders, you could use the standard file open dialog box, first setting the mask of file extensions to show only pdf files

if you want to retireve a list of pdf files from a given folder, you could use Dir(*.pdf) - see help for details of how to use it

Actaully there may be a third way, have you investigated the FileSystem Object?



Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi Ken, thanks for your advice.
I had never used before the Dir() method, it seems to be useful.
How can I do to use the standard file open dialog box? (I found the OpenTextFile method, but I think it doesn't work for non textual files).
This time I solved my problem using FileSystemObject and then opening an explorer window.
I used FileSystem Object to create a new folder:

Set fs = CreateObject("Scripting.FileSystemObject")
fs.createfolder ("path\" & azFolder)

and to check wheter the folder already exists or not:

fs.FolderExists("path\" & azFolder)

I tried with GetFolder method but I couldn't open it.
So I opened Explorer with a Shell calling.

azAppName = "C:\winnt\explorer.exe " & "MyPath\" & azFolder
Call Shell(azAppName, 1)

Thanks,
Elena
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top