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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File dialog Box for Graphics with view option 2

Status
Not open for further replies.

TimTDP

Technical User
Feb 15, 2004
373
0
0
ZA
I need to select a graphic file.
How can I create a file dialog box that lets me navigate folders, and when I click on a file shows a preview of the graphic?
 
make a reference to the Microsoft Scripting Runtime and use the FileSystemObject to navigate the file structure yourself. Set up a few listboxes and bob's ya uncle. A picture box can hold the preview!
hth
steve
 
Any chance that you can provide sample code?
Thanks so far
 
The standard Windows File Open/Save dialog box, I think, should give that through clicking the view button and selecting preview. Here's a handy wrapper for that Call the standard Windows File Open/Save dialog box, but I'm not sure how to get it in "preview mode" programatically.

If you're using 2002 or higher versions, you should be able to use the FileDialog, for instance like this:
[tt]
dim dlg as filedialog
dim varFile as variant

set dlg = application.filedialog(msoFileDialogFilePicker)

with dlg
.initialview = msoFileDialogViewPreview
.filters.add "Piccies", "*.bmp;*.jpg;*.gif;*.ico;*.wmf", 1
if .show then
for each varFile in .selecteditems
msgbox varFile
next varFile
end if
end with

set dlg = nothing[/tt]

You will need a reference to the Microsoft Office Object library to use this (in VBE - Tools | References)

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top