Access.2007.VBA.Bibl..

(John Hannent) #1
The FileDialogobject has several useful methods and properties:

n Filters.Add— Lets you specify the filter(s) for displaying files, such as
fd.Filters.Add “Word documents”, “*.doc”

n InitialFileName— The default file name, for a File Picker dialog; the default path
for a Folder Picker dialog
n ButtonName— The button caption (in case you want something other than “Select”).
n DialogType— A selection of File Picker, Folder Picker, Open, or Save As dialog type
(from the MsoFileDialogTypeenum, which can be viewed in the Object Browser).
n InitialView— Lets you set the view for the dialog (Details, Large Icons, Preview, and so
on). Look at the MsoFileDialogViewenum in the Object Browser for the full selection.
n AllowMultiSelect— If set to True, lets users select multiple files in the dialog (for
File Picker dialogs only).

Figure 9.4 shows the MsoFileDialogViewenum, with all the options for setting the view for
the dialog.

FIGURE 9.4
Viewing the MsoFileDialogViewenum in the Object Browser.

Part II Writing VBA Code to Exchange Data between Office Components

Free download pdf