• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

4. Applications > 4.8. Use the Windows File Open/Save Common Dialogs

4.8. Use the Windows File Open/Save Common Dialogs

Problem

You need to allow users to choose filenames for opening and saving files. You know that Windows supports a common way to get these names. How can you use this mechanism from within Access?

Solution

Not only can you use the common File Open/Save dialogs, but you even have three ways to do it:

  • You can use the ActiveX control, COMMDLG.OCX, that ships with the some versions of the developer version of Office, and with Visual Basic.

  • In Access 2002 and later, you can use the FileDialog object.

  • You can call the Windows API directly.

If you don’t have the developer version of Office, or Visual Basic, the first suggestion won’t help. In addition, distribution of applications that use the common dialog ActiveX can get complex, because of ActiveX versioning issues. The FileDialog object added in Access 2002 makes it easier to select files, but it’s not available in earlier versions. Therefore, this solution shows how to call the Windows API directly and lists all the options you have when using these common dialogs.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint