File To Open Dialog box 
Author Message
 File To Open Dialog box

Hello,

I am running the following in Excel and was trying to figure out how to do
this in Access.  This code opens the "File Open" dialog box, allows you to
select the file(s) and then process those files.  Thanks for the help:

    fileToOpen = Application.GetOpenFilename("MyFileType (*.csv),*.csv", ,
"Open My Files", , True)
    If TypeName(fileToOpen) = "Boolean" Then Exit Sub

    For ctrOpen = 1 To UBound(fileToOpen)
        MsgBox fileToOpen(ctrOpen)
    Next

Steven



Mon, 15 Dec 2003 02:16:39 GMT  
 File To Open Dialog box

writes:

Quote:
>Hello,

>I am running the following in Excel and was trying to figure out how to do
>this in Access.  This code opens the "File Open" dialog box, allows you to
>select the file(s) and then process those files.  Thanks for the help:

>    fileToOpen = Application.GetOpenFilename("MyFileType (*.csv),*.csv", ,
>"Open My Files", , True)
>    If TypeName(fileToOpen) = "Boolean" Then Exit Sub

>    For ctrOpen = 1 To UBound(fileToOpen)
>        MsgBox fileToOpen(ctrOpen)
>    Next

>Steven

Steven

Access does not have a built-in method of doing this. The best way (ie the
least likely to break) is to use the API for the Windows File Open/Save dialog
directly. The code for this is at The Access Web at http://www.mvps.org/access
in the API section. Just copy the code into a new module, and change the sample
function to only show the file types that you want. Although this might seem
very complicated, you don't need to understand how it works, just treat it as a
'black box'.

Jon

Access tips & tricks - http://www.applecore99.com
Microsoft Access webring -
http://nav.webring.yahoo.com/hub?ring=microsoftaccess



Mon, 15 Dec 2003 04:52:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Order Of Files In Open Dialog Box

2. Open file dialog box and upload file

3. File Open Dialog Box

4. Open File Dialog Box

5. Open File Dialog Box

6. Open file Dialog Box in Access..Please Help

7. Open File Dialog Box

8. A File Open type dialog box

9. Open File Common Dialog Boxes in Access95 VBA Code

10. open file dialog box?

11. How To show only directories with Common Dialog Box for open files

12. Open File Dialog Box

 

 
Powered by phpBB® Forum Software